Support moving download location (e.g., between internal and external storage)
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
### [REQUIRED] Use case description
I'm trying to implement a way for users to switch from internal storage to external storage (e.g. SD card), and I want to preserve all downloads when doing that. I'm releasing the current cache, copying all the files, and creating a new cache pointing to the new directory (I'm using `SimpleCache`). I'm also creating a new `DownloadManager` with the new cache, but in the end that doesn't matter because the `DownloadService` will still be stuck to the old `DownloadManager` (pointing to the old cache) thanks to the static `downloadManagerListeners` that hold the `DownloadManagerHelper` which holds the `DownloadManager`.
### Proposed solution
Ideally it'd be great if we had an API that would do all the work needed to switch between internal storage to external storage. But if we have a way to simply update the `DownloadManager` instance held by `DownloadService`, we'd be able to do the rest ourselves.
### Alternatives considered
At first I thought we could simply have a protected method that clears the `downloadManagerListeners`, but I don't fully understand its purpose yet, so I'm not sure whether that's reasonable or not.
On our end one solution is to simply kill the process and restart the app, but that's definitely overkill and would be far from good to the users.
Contributor guide
Assessment
This issue has not been assessed yet.