Fix favicon retrieval from cache, disable preemptive favicon fetching
This commit is contained in:
parent
6061db0b14
commit
fbb820faf6
@ -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…
Reference in New Issue
Block a user