Fall back to internal cache if external is null

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

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

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