From 9e0d8f7e0018bafdef94dc1e5e16e1cc19230a4c Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Tue, 11 Jun 2013 17:57:44 +0100 Subject: [PATCH] Bug 877870 - Make favicon loading optional in updateFromCursor() (r=sriram) --- mobile/android/base/home/TwoLinePageRow.java | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mobile/android/base/home/TwoLinePageRow.java b/mobile/android/base/home/TwoLinePageRow.java index e52744f5665c..32098ce70ad8 100644 --- a/mobile/android/base/home/TwoLinePageRow.java +++ b/mobile/android/base/home/TwoLinePageRow.java @@ -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); + } } }