Merge "Notification: Fix bigLargeIcon" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0b22e395d2
@@ -3771,8 +3771,24 @@ public class Notification implements Parcelable
|
|||||||
}
|
}
|
||||||
|
|
||||||
private RemoteViews makeBigContentView() {
|
private RemoteViews makeBigContentView() {
|
||||||
|
|
||||||
|
// Replace mLargeIcon with mBigLargeIcon if mBigLargeIconSet
|
||||||
|
// This covers the following cases:
|
||||||
|
// 1. mBigLargeIconSet -> mBigLargeIcon (null or non-null) applies, overrides
|
||||||
|
// mLargeIcon
|
||||||
|
// 2. !mBigLargeIconSet -> mLargeIcon applies
|
||||||
|
Bitmap oldLargeIcon = null;
|
||||||
|
if (mBigLargeIconSet) {
|
||||||
|
oldLargeIcon = mBuilder.mLargeIcon;
|
||||||
|
mBuilder.mLargeIcon = mBigLargeIcon;
|
||||||
|
}
|
||||||
|
|
||||||
RemoteViews contentView = getStandardView(mBuilder.getBigPictureLayoutResource());
|
RemoteViews contentView = getStandardView(mBuilder.getBigPictureLayoutResource());
|
||||||
|
|
||||||
|
if (mBigLargeIconSet) {
|
||||||
|
mBuilder.mLargeIcon = oldLargeIcon;
|
||||||
|
}
|
||||||
|
|
||||||
contentView.setImageViewBitmap(R.id.big_picture, mPicture);
|
contentView.setImageViewBitmap(R.id.big_picture, mPicture);
|
||||||
|
|
||||||
applyTopPadding(contentView);
|
applyTopPadding(contentView);
|
||||||
@@ -3803,6 +3819,7 @@ public class Notification implements Parcelable
|
|||||||
super.restoreFromExtras(extras);
|
super.restoreFromExtras(extras);
|
||||||
|
|
||||||
if (extras.containsKey(EXTRA_LARGE_ICON_BIG)) {
|
if (extras.containsKey(EXTRA_LARGE_ICON_BIG)) {
|
||||||
|
mBigLargeIconSet = true;
|
||||||
mBigLargeIcon = extras.getParcelable(EXTRA_LARGE_ICON_BIG);
|
mBigLargeIcon = extras.getParcelable(EXTRA_LARGE_ICON_BIG);
|
||||||
}
|
}
|
||||||
mPicture = extras.getParcelable(EXTRA_PICTURE);
|
mPicture = extras.getParcelable(EXTRA_PICTURE);
|
||||||
|
|||||||
Reference in New Issue
Block a user