For privacy reasons, we should give priority to internal storage cache

Cache directory contains all thumbnails and image from secret chat.
We should save them in internal storage instead of publicly accessible external storage cache.
This commit is contained in:
Eugenio Baglieri 2018-03-01 15:46:19 +01:00 committed by GitHub
parent e9e40cb13e
commit cb4d375773
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -479,6 +479,14 @@ public class AndroidUtilities {
} catch (Exception e) {
FileLog.e(e);
}
try {
File file = ApplicationLoader.applicationContext.getCacheDir();
if (file != null) {
return file;
}
} catch (Exception e) {
FileLog.e(e);
}
if (state == null || state.startsWith(Environment.MEDIA_MOUNTED)) {
try {
File file = ApplicationLoader.applicationContext.getExternalCacheDir();
@ -489,14 +497,6 @@ public class AndroidUtilities {
FileLog.e(e);
}
}
try {
File file = ApplicationLoader.applicationContext.getCacheDir();
if (file != null) {
return file;
}
} catch (Exception e) {
FileLog.e(e);
}
return new File("");
}