Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e9bb422 authored by Daniel Sandler's avatar Daniel Sandler Committed by Michael Bestas
Browse files

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
parent 5672919e
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -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) {