google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

StandaloneDatabaseProvider is deleting other DBs in application files. #10398

Open akshansh01 opened 2 years ago

akshansh01 commented 2 years ago

Hi, I'm following this guide to have offline download in our application. https://exoplayer.dev/downloading-media.html#creating-a-downloadmanager

In my application, I have some native code, which uses sqlite plugin to load / create databases in application folder under specific directory. Let's say DB1.

Now when I integrated downloadManager, and started the service, it's deleting all DB1 db files. I can see exoplayer.db created in database folder.

What can be the reason for this ? Any clue, or some things I can do to debug ?

@ojw28

akshansh01 commented 2 years ago

For others: When I moved my DBs used by native code in application 'databases' folder, it was not getting deleted. Earlier it was just sitting in application file dir.

So, if you need to have multiple sqlite databases, keep in context.getDatabasePath(), by making a new file/folder there.

I'm not sure why sqlite is deleting dbs when not in 'database' folder. And this issue came only with 'DownloadManager'.