Bug 877870 - Make favicon loading optional in updateFromCursor() (r=sriram)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 11 Jun 2013 17:57:44 +0100
changeset 143312 8b24cd7f46aeede79c53ef0b7853e4703636f945
parent 143311 2e9bcd6958013330e15c5ea8dc8316445f8d2510
child 143313 06bd6a21602252a120e4c9504513d8df296d4baf
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram
bugs877870
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 877870 - Make favicon loading optional in updateFromCursor() (r=sriram)
mobile/android/base/home/TwoLinePageRow.java
--- a/mobile/android/base/home/TwoLinePageRow.java
+++ b/mobile/android/base/home/TwoLinePageRow.java
@@ -69,20 +69,24 @@ public class TwoLinePageRow extends Line
         if (tabId != null) {
             mUrl.setText(R.string.switch_to_tab);
             mUrl.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_url_bar_tab, 0, 0, 0);
         } else {
             mUrl.setText(url);
             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);
+
+            Bitmap favicon = null;
+            if (b != null) {
+                Bitmap bitmap = BitmapUtils.decodeByteArray(b);
+                if (bitmap != null) {
+                    favicon = Favicons.getInstance().scaleImage(bitmap);
+                }
             }
+
+            mFavicon.updateImage(favicon, url);
         }
-
-        mFavicon.updateImage(favicon, url);
     }
 }