Bug 1398326 Fix display of default extension icon in permission prompts r=walkingice
authorAndrew Swan <aswan@mozilla.com>
Fri, 08 Sep 2017 13:21:42 -0700
changeset 429551 27cf5225d7e0629db23a1419aefeddc3c3677fb7
parent 429550 1a31654a23d3949e405d7a25d8061c7d41ae6d7b
child 429552 307b5682dec342ab187af9e13ee006c36bd09da8
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswalkingice
bugs1398326
milestone57.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 1398326 Fix display of default extension icon in permission prompts r=walkingice MozReview-Commit-ID: 9qaAVcAeJuf
mobile/android/base/java/org/mozilla/gecko/extensions/ExtensionPermissionsHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/extensions/ExtensionPermissionsHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/extensions/ExtensionPermissionsHelper.java
@@ -11,17 +11,16 @@ import org.mozilla.gecko.util.EventCallb
 import org.mozilla.gecko.util.GeckoBundle;
 import org.mozilla.gecko.util.ResourceDrawableUtils;
 import org.mozilla.gecko.R;
 
 import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
 
 public class ExtensionPermissionsHelper implements BundleEventListener {
     private final Context mContext;
 
@@ -63,17 +62,20 @@ public class ExtensionPermissionsHelper 
                 @Override
                 public void onClick(DialogInterface dialog, int whichButton) {
                     callback.sendSuccess(false);
                 }
             });
 
             final String iconUrl = message.getString("icon");
             if ("DEFAULT".equals(iconUrl)) {
-                headerText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_extension, 0, 0, 0);
+                final Drawable d = ResourceDrawableUtils.getDrawable(mContext, R.drawable.ic_extension);
+                if (d != null) {
+                    headerText.setCompoundDrawablesWithIntrinsicBounds(d, null, null, null);
+                }
             } else {
                 ResourceDrawableUtils.getDrawable(mContext, iconUrl, new ResourceDrawableUtils.BitmapLoader() {
                         @Override
                         public void onBitmapFound(final Drawable d) {
                             headerText.setCompoundDrawablesWithIntrinsicBounds(d, null, null, null);
                         }
                     });
             }