Small improvements

pull/214/head
M66B 12 months ago
parent a1e7d5e638
commit f60afc497b

@ -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,

@ -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;
}
}

Loading…
Cancel
Save