diff options
author | Tony Wickham <twickham@google.com> | 2017-03-15 17:30:30 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-15 17:30:30 +0000 |
commit | 185f854bfa94a195a3a18551d80b3f5f9bc4c326 (patch) | |
tree | 56703f4969fbb552b3de1e91bb171ef9efcb04f8 /src/com/android | |
parent | 961941f10239bb8408cd4642b28fab5acb4e6aa9 (diff) | |
parent | a431fbb85090b180673c38b6d88f492a805282d6 (diff) | |
download | android_packages_apps_Trebuchet-185f854bfa94a195a3a18551d80b3f5f9bc4c326.tar.gz android_packages_apps_Trebuchet-185f854bfa94a195a3a18551d80b3f5f9bc4c326.tar.bz2 android_packages_apps_Trebuchet-185f854bfa94a195a3a18551d80b3f5f9bc4c326.zip |
Merge "Use default icon if notification icon is null." into ub-launcher3-dorval
am: a431fbb850
Change-Id: I493ea6c4248c81f33e5267e2450e646cff23c955
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/notification/NotificationInfo.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/launcher3/notification/NotificationInfo.java b/src/com/android/launcher3/notification/NotificationInfo.java index 77a18c732..58e2e039f 100644 --- a/src/com/android/launcher3/notification/NotificationInfo.java +++ b/src/com/android/launcher3/notification/NotificationInfo.java @@ -20,6 +20,7 @@ import android.app.ActivityOptions; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.os.Bundle; @@ -27,6 +28,7 @@ import android.service.notification.StatusBarNotification; import android.view.View; import com.android.launcher3.Launcher; +import com.android.launcher3.LauncherAppState; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.util.PackageUserKey; @@ -53,8 +55,8 @@ public class NotificationInfo implements View.OnClickListener { public final boolean autoCancel; public final boolean dismissable; - private final int mBadgeIcon; - private final Drawable mIconDrawable; + private int mBadgeIcon; + private Drawable mIconDrawable; private int mIconColor; private boolean mIsIconLarge; @@ -82,6 +84,12 @@ public class NotificationInfo implements View.OnClickListener { mIconDrawable = icon.loadDrawable(context); mIsIconLarge = true; } + if (mIconDrawable == null) { + mIconDrawable = new BitmapDrawable(context.getResources(), LauncherAppState + .getInstance(context).getIconCache() + .getDefaultIcon(statusBarNotification.getUser())); + mBadgeIcon = BADGE_ICON_NONE; + } intent = notification.contentIntent; autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0; dismissable = (notification.flags & Notification.FLAG_ONGOING_EVENT) == 0; |