diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index 4181e36d16..82c5254ccd 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -666,7 +666,7 @@ public class ContactInfo { for (int i = 0; i < imgs.size(); i++) Log.i("Favicon " + i + "=" + imgs.get(i) + " @" + base); - List> futures = new ArrayList<>(); + List>> futures = new ArrayList<>(); for (Element img : imgs) { String rel = img.attr("rel").trim().toLowerCase(Locale.ROOT); if (REL_EXCLUDE.contains(rel)) // dns-prefetch: gmx.net @@ -679,17 +679,19 @@ public class ContactInfo { continue; final URL url = new URL(base, favicon); - futures.add(executorFavicon.submit(new Callable() { + futures.add(executorFavicon.submit(new Callable>() { @Override - public Favicon call() throws Exception { - return getFavicon(url, img.attr("type"), scaleToPixels, context); + public Pair call() throws Exception { + return new Pair(getFavicon(url, img.attr("type"), scaleToPixels, context), url); } })); } - for (Future future : futures) + for (Future> future : futures) try { - return future.get(); + Pair result = future.get(); + Log.i("Using favicon=" + result.second); + return result.first; } catch (Throwable ex) { if (ex.getCause() instanceof FileNotFoundException || ex.getCause() instanceof CertPathValidatorException)