mirror of https://github.com/M66B/FairEmail.git
Clear contact info on low memory
This commit is contained in:
parent
d0807bb283
commit
e5bfbce6b0
|
@ -152,6 +152,9 @@ public class ApplicationEx extends Application {
|
|||
Map<String, String> crumb = new HashMap<>();
|
||||
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
||||
Log.breadcrumb("low", crumb);
|
||||
|
||||
ContactInfo.clearCache(this, false);
|
||||
|
||||
super.onLowMemory();
|
||||
}
|
||||
|
||||
|
|
|
@ -138,12 +138,22 @@ public class ContactInfo {
|
|||
}
|
||||
|
||||
static void clearCache(Context context) {
|
||||
clearCache(context, true);
|
||||
}
|
||||
|
||||
static void clearCache(Context context, boolean files) {
|
||||
synchronized (emailContactInfo) {
|
||||
emailContactInfo.clear();
|
||||
}
|
||||
|
||||
final File dir = new File(context.getCacheDir(), "favicons");
|
||||
synchronized (emailGravatar) {
|
||||
emailGravatar.clear();
|
||||
}
|
||||
|
||||
if (!files)
|
||||
return;
|
||||
|
||||
final File dir = new File(context.getCacheDir(), "favicons");
|
||||
executorFavicon.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
Loading…
Reference in New Issue