OSDN Git Service

Fix icon-related crash.
authorDan Sandler <dsandler@android.com>
Thu, 14 May 2015 13:42:50 +0000 (09:42 -0400)
committerDan Sandler <dsandler@android.com>
Thu, 14 May 2015 13:53:31 +0000 (09:53 -0400)
Bug: 21144636
Change-Id: Ib686e9a9a18ac6b9f1e249bcde74be9212e0f53b

core/java/android/app/Notification.java

index 3ffeea7..cb6f7d5 100644 (file)
@@ -3191,8 +3191,9 @@ public class Notification implements Parcelable
                         0xFFFFFFFF,
                         PorterDuff.Mode.SRC_ATOP, -1);
             }
-            final boolean gray = (smallIcon.getType() == Icon.TYPE_RESOURCE
-                    && mColorUtil.isGrayscaleIcon(mContext, smallIcon.getResId()));
+            final boolean gray = isLegacy()
+                    && smallIcon.getType() == Icon.TYPE_RESOURCE
+                    && mColorUtil.isGrayscaleIcon(mContext, smallIcon.getResId());
             if (!isLegacy() || gray) {
                 contentView.setInt(R.id.right_icon,
                         "setBackgroundResource",