mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
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:
parent
e9e40cb13e
commit
cb4d375773
1 changed files with 8 additions and 8 deletions
|
@ -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("");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue