diff options
author | Daniel Sandler <dsandler@android.com> | 2013-08-19 12:06:25 -0400 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-06-24 23:14:05 +0300 |
commit | ae370cfc5b60205d7a42938f08a8ba6f9faef20c (patch) | |
tree | 9939f10bd5bb9136cbcf64b86dbd2d2acf82a588 | |
parent | 376634a91ae7853aa26350bf0e549cdb51798548 (diff) | |
download | android_packages_apps_Etar-ae370cfc5b60205d7a42938f08a8ba6f9faef20c.tar.gz android_packages_apps_Etar-ae370cfc5b60205d7a42938f08a8ba6f9faef20c.tar.bz2 android_packages_apps_Etar-ae370cfc5b60205d7a42938f08a8ba6f9faef20c.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
-rw-r--r-- | src/com/android/calendar/alerts/AlertReceiver.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/calendar/alerts/AlertReceiver.java b/src/com/android/calendar/alerts/AlertReceiver.java index d4ee2ef6..67bf34fb 100644 --- a/src/com/android/calendar/alerts/AlertReceiver.java +++ b/src/com/android/calendar/alerts/AlertReceiver.java @@ -343,8 +343,7 @@ public class AlertReceiver extends BroadcastReceiver { priority, true); // 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(); @@ -362,7 +361,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); @@ -420,8 +420,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) { @@ -467,11 +466,11 @@ 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(); + NotificationWrapper nw = new NotificationWrapper(n); if (AlertService.DEBUG) { for (AlertService.NotificationInfo info : notificationInfos) { |