diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index 17f4a1c236..0280cf9901 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -177,7 +177,7 @@ public class ContactInfo { // Favicons Log.i("Cleanup avatars"); - for (String type : new String[]{"favicons", "generated"}) { + for (String type : new String[]{"notcontact", "favicons", "generated"}) { File[] favicons = Helper.ensureExists(context, type).listFiles(); if (favicons != null) for (File file : favicons) @@ -291,9 +291,10 @@ public class ContactInfo { Helper.hasPermission(context, Manifest.permission.READ_CONTACTS)) { File dir = Helper.ensureExists(context, "notcontact"); File file = new File(dir, ekey); - if (file.exists()) + if (file.exists()) { + file.setLastModified(new Date().getTime()); Log.i("Contact negative cache key=" + ekey); - else { + } else { ContentResolver resolver = context.getContentResolver(); Uri uri = Uri.withAppendedPath( ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI, diff --git a/app/src/play/java/eu/faircode/email/ApplicationSecure.java b/app/src/play/java/eu/faircode/email/ApplicationSecure.java index b8196cc28f..5dc4f6d42d 100644 --- a/app/src/play/java/eu/faircode/email/ApplicationSecure.java +++ b/app/src/play/java/eu/faircode/email/ApplicationSecure.java @@ -32,6 +32,8 @@ import java.util.concurrent.TimeUnit; public class ApplicationSecure extends ApplicationEx implements ProviderInstaller.ProviderInstallListener { private static final CountDownLatch lock = new CountDownLatch(1); + private static final long WAIT_INSTALLED = 750L; // milliseconds + @Override public void onCreate() { super.onCreate(); @@ -61,11 +63,11 @@ public class ApplicationSecure extends ApplicationEx implements ProviderInstalle public static boolean waitProviderInstalled() { Log.i("Security provider wait"); try { - boolean succeeded = lock.await(500L, TimeUnit.MILLISECONDS); + boolean succeeded = lock.await(WAIT_INSTALLED, TimeUnit.MILLISECONDS); Log.i("Security provider wait succeeded=" + succeeded); return succeeded; } catch (InterruptedException ex) { - Log.e(ex); + Log.i(ex); return false; } }