Delete "external" persistent blobs on cleanup

Also switch external persistent blog directory to cache

Fixes #6909
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-11-03 10:53:37 -07:00
parent 3ed82c1726
commit 3e9bfcb3fd
2 changed files with 16 additions and 1 deletions

View File

@@ -141,6 +141,10 @@ public class PersistentBlobProvider {
return getFile(ContentUris.parseId(uri)).delete();
}
if (isExternalBlobUri(context, uri)) {
return new File(uri.getPath()).delete();
}
return false;
}
@@ -219,7 +223,7 @@ public class PersistentBlobProvider {
}
private static @NonNull File getExternalDir(Context context) throws IOException {
final File externalDir = context.getExternalFilesDir(null);
final File externalDir = context.getExternalCacheDir();
if (externalDir == null) throw new IOException("no external files directory");
return externalDir;
}