Prioritize hires favicon

pull/183/head
M66B 5 years ago
parent c5b2d0c258
commit 674d60243a

@ -306,8 +306,10 @@ public class ContactInfo {
info.bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); info.bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
else { else {
URL base = new URL("https://" + domain); URL base = new URL("https://" + domain);
URL www = new URL("https://www." + domain);
try { try {
info.bitmap = getFavicon(new URL(base, "favicon.ico")); info.bitmap = parseFavicon(base);
} catch (IOException ex) { } catch (IOException ex) {
if (ex instanceof SocketTimeoutException) if (ex instanceof SocketTimeoutException)
throw ex; throw ex;
@ -316,24 +318,30 @@ public class ContactInfo {
if (info.bitmap == null) if (info.bitmap == null)
try { try {
info.bitmap = parseFavicon(base); info.bitmap = parseFavicon(www);
} catch (IOException ex) { } catch (IOException ex) {
if (ex instanceof SocketTimeoutException) if (ex instanceof SocketTimeoutException)
throw ex; throw ex;
Log.i("Favicon ex=" + ex.getClass().getName() + " " + ex.getMessage()); Log.i("Favicon ex=" + ex.getClass().getName() + " " + ex.getMessage());
} }
URL www = new URL("https://www." + domain);
if (info.bitmap == null) if (info.bitmap == null)
try { try {
info.bitmap = getFavicon(new URL(www, "favicon.ico")); info.bitmap = getFavicon(new URL(base, "favicon.ico"));
} catch (IOException ex) { } catch (IOException ex) {
if (ex instanceof SocketTimeoutException) if (ex instanceof SocketTimeoutException)
throw ex; throw ex;
Log.i("Favicon ex=" + ex.getClass().getName() + " " + ex.getMessage()); Log.i("Favicon ex=" + ex.getClass().getName() + " " + ex.getMessage());
} }
if (info.bitmap == null) if (info.bitmap == null)
info.bitmap = parseFavicon(www); try {
info.bitmap = getFavicon(new URL(www, "favicon.ico"));
} catch (IOException ex) {
if (ex instanceof SocketTimeoutException)
throw ex;
Log.i("Favicon ex=" + ex.getClass().getName() + " " + ex.getMessage());
}
// Add to cache // Add to cache
if (info.bitmap == null) if (info.bitmap == null)

Loading…
Cancel
Save