mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 10:47:46 +00:00
Start creating "persistent" blobs in cache directory
Helps #5515 // FREEBIE
This commit is contained in:
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…
x
Reference in New Issue
Block a user