diff options
author | Daniel Sandler <dsandler@android.com> | 2013-08-19 12:06:25 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2013-08-20 13:30:19 -0400 |
commit | 244d94f9a1a433fd3403452f2cdeba5c862b9650 (patch) | |
tree | f61590e0023ff2c09f5e630b228c315e759b34e2 /src | |
parent | dea96f146854378d388f21ed873502b8ee9d1d91 (diff) | |
download | android_packages_apps_Calendar-244d94f9a1a433fd3403452f2cdeba5c862b9650.tar.gz android_packages_apps_Calendar-244d94f9a1a433fd3403452f2cdeba5c862b9650.tar.bz2 android_packages_apps_Calendar-244d94f9a1a433fd3403452f2cdeba5c862b9650.zip |
Call build() on the Builder, not the Style.
There are bugs in Style.build() around extras that this
avoids. This CL also uses the setStyle() API to make it more
explicit that calling build() on the Builder will still
include everything in the Style.
Bug: 10387352
Change-Id: I5f3d8d59944885d2c87369cbdc81cb57f248fcc7
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/calendar/alerts/AlertReceiver.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/com/android/calendar/alerts/AlertReceiver.java b/src/com/android/calendar/alerts/AlertReceiver.java index 481619d9..83dcc9fc 100644 --- a/src/com/android/calendar/alerts/AlertReceiver.java +++ b/src/com/android/calendar/alerts/AlertReceiver.java @@ -417,8 +417,7 @@ public class AlertReceiver extends BroadcastReceiver { priority, true); if (Utils.isJellybeanOrLater()) { // Create a new-style expanded notification - Notification.BigTextStyle expandedBuilder = new Notification.BigTextStyle( - basicBuilder); + Notification.BigTextStyle expandedBuilder = new Notification.BigTextStyle(); if (description != null) { description = mBlankLinePattern.matcher(description).replaceAll(""); description = description.trim(); @@ -436,7 +435,8 @@ public class AlertReceiver extends BroadcastReceiver { text = stringBuilder; } expandedBuilder.bigText(text); - notification = expandedBuilder.build(); + basicBuilder.setStyle(expandedBuilder); + notification = basicBuilder.build(); } return new NotificationWrapper(notification, notificationId, eventId, startMillis, endMillis, doPopup); @@ -495,8 +495,7 @@ public class AlertReceiver extends BroadcastReceiver { if (expandable) { // Multiple reminders. Combine into an expanded digest notification. - Notification.InboxStyle expandedBuilder = new Notification.InboxStyle( - notificationBuilder); + Notification.InboxStyle expandedBuilder = new Notification.InboxStyle(); int i = 0; for (AlertService.NotificationInfo info : notificationInfos) { if (i < NOTIFICATION_DIGEST_MAX_LENGTH) { @@ -541,11 +540,10 @@ public class AlertReceiver extends BroadcastReceiver { // Remove the title in the expanded form (redundant with the listed items). expandedBuilder.setBigContentTitle(""); - - n = expandedBuilder.build(); - } else { - n = notificationBuilder.build(); + notificationBuilder.setStyle(expandedBuilder); } + + n = notificationBuilder.build(); } else { // Old-style notification (pre-JB). We only need a standard notification (no // buttons) but use a custom view so it is consistent with the others. |