Browse Source

Fix favicon retrieval from cache, disable preemptive favicon fetching

master
anthony restaino 8 years ago
parent
commit
fbb820faf6
  1. 23
      app/src/main/java/acr/browser/lightning/favicon/FaviconModel.java

23
app/src/main/java/acr/browser/lightning/favicon/FaviconModel.java

@ -136,14 +136,15 @@ public class FaviconModel {
File faviconCacheFile = createFaviconCacheFile(mApplication, uri); File faviconCacheFile = createFaviconCacheFile(mApplication, uri);
Bitmap favicon = getFaviconFromMemCache(url); Bitmap favicon = getFaviconFromMemCache(url);
if (faviconCacheFile.exists() && favicon != null) { if (faviconCacheFile.exists() && favicon == null) {
favicon = mImageFetcher.retrieveFaviconFromCache(faviconCacheFile); favicon = mImageFetcher.retrieveFaviconFromCache(faviconCacheFile);
} }
if (favicon == null) { if (favicon == null) {
favicon = mImageFetcher.retrieveBitmapFromDomain(uri); // favicon = mImageFetcher.retrieveBitmapFromDomain(uri);
} else { } else {
Bitmap newFavicon = Utils.padFavicon(favicon); Bitmap newFavicon = Utils.padFavicon(favicon);
@ -153,18 +154,18 @@ public class FaviconModel {
return; return;
} }
if (favicon == null && allowGoogleService) { // if (favicon == null && allowGoogleService) {
favicon = mImageFetcher.retrieveBitmapFromGoogle(uri); // favicon = mImageFetcher.retrieveBitmapFromGoogle(uri);
} // }
if (favicon != null) { // if (favicon != null) {
addFaviconToMemCache(url, favicon); // addFaviconToMemCache(url, favicon);
cacheFaviconForUrl(favicon, url).subscribe(); // cacheFaviconForUrl(favicon, url).subscribe();
} // }
if (favicon == null) { // if (favicon == null) {
favicon = defaultFavicon; favicon = defaultFavicon;
} // }
Bitmap newFavicon = Utils.padFavicon(favicon); Bitmap newFavicon = Utils.padFavicon(favicon);

Loading…
Cancel
Save