Start creating "persistent" blobs in cache directory
Helps #5515 // FREEBIE
This commit is contained in:
parent
381237a315
commit
526d510423
1 changed files with 12 additions and 0 deletions
|
@ -151,9 +151,21 @@ public class PersistentBlobProvider {
|
|||
}
|
||||
|
||||
private File getFile(long id) {
|
||||
File legacy = getLegacyFile(id);
|
||||
File cache = getCacheFile(id);
|
||||
|
||||
if (legacy.exists()) return legacy;
|
||||
else return cache;
|
||||
}
|
||||
|
||||
private File getLegacyFile(long id) {
|
||||
return new File(context.getDir("captures", Context.MODE_PRIVATE), id + "." + BLOB_EXTENSION);
|
||||
}
|
||||
|
||||
private File getCacheFile(long id) {
|
||||
return new File(context.getCacheDir(), "capture-" + id + "." + BLOB_EXTENSION);
|
||||
}
|
||||
|
||||
private @Nullable String getEncryptedFileName(@NonNull MasterSecret masterSecret, @Nullable String fileName) {
|
||||
if (fileName == null) return null;
|
||||
return new MasterCipher(masterSecret).encryptBody(fileName);
|
||||
|
|
Loading…
Add table
Reference in a new issue