summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sandler <dsandler@android.com>2015-02-25 13:20:39 -0500
committerThe Android Automerger <android-build@google.com>2015-03-25 18:49:42 -0700
commit4faaaf6457f55b71018c5e254eff59a6f0ce6c6a (patch)
tree81c8cf5e3730a1b60672f8d4c221b16fac070a16
parent157cf3317c7104e7afd8a24eaac1467b9bfa2dd9 (diff)
downloadbase-4faaaf6457f55b71018c5e254eff59a6f0ce6c6a.tar.gz
Avoid crashing on corrupted notifications.
If a notification content view has an @id/icon or @id/right_icon, we need to make sure those ImageViews actually have a drawable inside. Bug: 19487078 Change-Id: I4ef6c4a10926823aa8680628097ed150d9e717d4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
index 59b62e50c1e1..57d162beb224 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationTemplateViewWrapper.java
@@ -79,7 +79,8 @@ public class NotificationTemplateViewWrapper extends NotificationViewWrapper {
// If the icon already has a color filter, we assume that we already forced the icon to be
// white when we created the notification.
- mIconForceGraysaleWhenDark = mIcon != null && mIcon.getDrawable().getColorFilter() != null;
+ final Drawable iconDrawable = mIcon != null ? mIcon.getDrawable() : null;
+ mIconForceGraysaleWhenDark = iconDrawable != null && iconDrawable.getColorFilter() != null;
}
private ImageView resolveIcon(ImageView largeIcon, ImageView rightIcon) {