Fall back to internal cache if external is null

pull/795/head
Alex Baker 7 years ago
parent 0342936b07
commit 9113c730ac

@ -426,10 +426,15 @@ public class Preferences {
} }
public Uri getCacheDirectory() { public Uri getCacheDirectory() {
File cacheDir = context.getExternalCacheDir();
if (cacheDir == null) {
cacheDir = context.getCacheDir();
}
if (atLeastKitKat()) { if (atLeastKitKat()) {
return DocumentFile.fromFile(context.getExternalCacheDir()).getUri(); return DocumentFile.fromFile(cacheDir).getUri();
} else { } else {
return Uri.fromFile(context.getExternalCacheDir()); return Uri.fromFile(cacheDir);
} }
} }

@ -6,4 +6,7 @@
<external-cache-path <external-cache-path
name="external_cache" name="external_cache"
path="." /> path="." />
<cache-path
name="internal_cache"
path="." />
</paths> </paths>
Loading…
Cancel
Save