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
diff --git a/src/com/android/calendar/alerts/AlertReceiver.java b/src/com/android/calendar/alerts/AlertReceiver.java
index 481619d..83dcc9f 100644
--- a/src/com/android/calendar/alerts/AlertReceiver.java
+++ b/src/com/android/calendar/alerts/AlertReceiver.java
@@ -417,8 +417,7 @@
                 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 @@
                 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 @@
 
             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 @@
 
                 // 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.