Bug 877870 - Make favicon loading optional in updateFromCursor() (r=sriram)

This commit is contained in:
Lucas Rocha 2013-06-11 17:57:44 +01:00
parent 58841a16ee
commit 9e0d8f7e00

View File

@ -74,15 +74,19 @@ public class TwoLinePageRow extends LinearLayout {
mUrl.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
}
byte[] b = cursor.getBlob(cursor.getColumnIndexOrThrow(URLColumns.FAVICON));
Bitmap favicon = null;
if (b != null) {
Bitmap bitmap = BitmapUtils.decodeByteArray(b);
if (bitmap != null) {
favicon = Favicons.getInstance().scaleImage(bitmap);
}
}
int faviconIndex = cursor.getColumnIndex(URLColumns.FAVICON);
if (faviconIndex != -1) {
byte[] b = cursor.getBlob(faviconIndex);
mFavicon.updateImage(favicon, url);
Bitmap favicon = null;
if (b != null) {
Bitmap bitmap = BitmapUtils.decodeByteArray(b);
if (bitmap != null) {
favicon = Favicons.getInstance().scaleImage(bitmap);
}
}
mFavicon.updateImage(favicon, url);
}
}
}