summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2016-08-04 12:55:48 -0700
committer Selim Cinek <cinek@google.com> 2016-08-04 13:04:29 -0700
commite99acb29db6ae9654be17e94bcc28b7e837784ed (patch)
tree854cb88f4296bf0273389f8969917057fd8135c2
parentd393d5c1e51e61b7ac61d3415586b696ee5c5f2a (diff)
Fixes a bug where setting a null bigLargeIcon would not clear it
Because we were also looking for legacy icons and the legacy icon was always restored for old listeners, the icon would not disappear. Change-Id: Id911d405e5ae00bf45e34368effbf67c2425a40c Fixes: 30663590
-rw-r--r--core/java/android/app/Notification.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4802b29bdeec..6e01922d20bf 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -4424,9 +4424,15 @@ public class Notification implements Parcelable
// mN.mLargeIcon
// 2. !mBigLargeIconSet -> mN.mLargeIcon applies
Icon oldLargeIcon = null;
+ Bitmap largeIconLegacy = null;
if (mBigLargeIconSet) {
oldLargeIcon = mBuilder.mN.mLargeIcon;
mBuilder.mN.mLargeIcon = mBigLargeIcon;
+ // The legacy largeIcon might not allow us to clear the image, as it's taken in
+ // replacement if the other one is null. Because we're restoring these legacy icons
+ // for old listeners, this is in general non-null.
+ largeIconLegacy = mBuilder.mN.largeIcon;
+ mBuilder.mN.largeIcon = null;
}
RemoteViews contentView = getStandardView(mBuilder.getBigPictureLayoutResource());
@@ -4438,6 +4444,7 @@ public class Notification implements Parcelable
if (mBigLargeIconSet) {
mBuilder.mN.mLargeIcon = oldLargeIcon;
+ mBuilder.mN.largeIcon = largeIconLegacy;
}
contentView.setImageViewBitmap(R.id.big_picture, mPicture);