diff options
author | Daniel Sandler <dsandler@android.com> | 2015-08-11 14:17:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-11 14:17:45 +0000 |
commit | ad7719dea4e8fd34854e4dcc918fc593c4416d82 (patch) | |
tree | d169d9b052c93173a7c2ec54ab0e9ff2dcc9a034 | |
parent | 4dbb37ae95bdf60d230777c6a5e8d53b932e9d40 (diff) | |
parent | 334398105f1119472988a1d5abc003051678752d (diff) | |
download | frameworks_base-ad7719dea4e8fd34854e4dcc918fc593c4416d82.zip frameworks_base-ad7719dea4e8fd34854e4dcc918fc593c4416d82.tar.gz frameworks_base-ad7719dea4e8fd34854e4dcc918fc593c4416d82.tar.bz2 |
Merge "Crash apps with bad notification icons." into mnc-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 00fa653..7065343 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -41,6 +41,7 @@ import android.content.res.Resources; import android.database.ContentObserver; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; +import android.graphics.drawable.Icon; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; @@ -1713,10 +1714,16 @@ public abstract class BaseStatusBar extends SystemUI implements sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()), n); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); + final Icon smallIcon = n.getSmallIcon(); + if (smallIcon == null) { + handleNotificationError(sbn, + "No small icon in notification from " + sbn.getPackageName()); + return null; + } final StatusBarIcon ic = new StatusBarIcon( sbn.getUser(), sbn.getPackageName(), - n.getSmallIcon(), + smallIcon, n.iconLevel, n.number, n.tickerText); |