summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christoph Studer <chstuder@google.com> 2014-12-15 16:32:27 +0100
committer Christoph Studer <chstuder@google.com> 2014-12-15 17:00:14 +0100
commit5c510ee551dd58d416578bc1247d672cfff84be8 (patch)
treeab447a0d2d39e36677648145ef454851a6755f2b
parent9ef07ad2b63edd4094bd8f15ccf861c7b014b2b0 (diff)
Notification: Fix bigLargeIcon
Fix a bug in L where BigPictureStyle.bigLargeIcon never made it into the notification layout. Bug: 18735551 Change-Id: Ia72d1de8cca2e95df3a99aaffeaba31325f1d858
-rw-r--r--core/java/android/app/Notification.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 9e8a79388af5..3a3602c33806 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3771,8 +3771,24 @@ public class Notification implements Parcelable
}
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());
+ if (mBigLargeIconSet) {
+ mBuilder.mLargeIcon = oldLargeIcon;
+ }
+
contentView.setImageViewBitmap(R.id.big_picture, mPicture);
applyTopPadding(contentView);
@@ -3803,6 +3819,7 @@ public class Notification implements Parcelable
super.restoreFromExtras(extras);
if (extras.containsKey(EXTRA_LARGE_ICON_BIG)) {
+ mBigLargeIconSet = true;
mBigLargeIcon = extras.getParcelable(EXTRA_LARGE_ICON_BIG);
}
mPicture = extras.getParcelable(EXTRA_PICTURE);