Fixes a bug where setting a null bigLargeIcon would not clear it

am: e99acb29db

Change-Id: Ib5f175bc50d8110f708c3541b3f0c0e715c41b87
This commit is contained in:
Selim Cinek
2016-08-08 19:30:21 +00:00
committed by android-build-merger

View File

@@ -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);