Start creating "persistent" blobs in cache directory

Helps #5515
// FREEBIE
pull/1/head
Moxie Marlinspike 8 years ago
parent 381237a315
commit 526d510423

@ -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…
Cancel
Save