SimpleCache: Try and retain UID if platform deletes from cache directory
Open
enhancement
low priority
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I see that `SimpleCache` creates a uid file in its cache dir. Also it has its own database to keep the list of files that are actually cached. That makes me wonder if `SimpleCache` is really compatible with `context.getCacheDir()`. What will happen when the OS removes all/parts of the files in cache directory? Does android delete files all togheter or it may delete some of them, probably that uid file, while keeping the reset.
```java
File cacheDir = new File(context.getCacheDir(), "TrackPlayer");
DatabaseProvider db = new ExoDatabaseProvider(context);
cache = new SimpleCache(cacheDir, new LeastRecentlyUsedCacheEvictor(cacheMaxSize), db);
```
Contributor guide
Assessment
This issue has not been assessed yet.