From 0b4aeab281d0bd18e67f245eeccbbc468f3065f1 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 1 Sep 2015 17:07:38 -0700 Subject: [PATCH] Fixed a crash in the notification group manager When 2 notifications were posted as the summary of the same group, then the system would eventually crash. Bug: 23676310 Change-Id: Ia8f95e624f3f43d1b55169dd8102e3c89427dc76 --- .../systemui/statusbar/phone/NotificationGroupManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java index 950b1627475d2..310625e78288a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java @@ -78,6 +78,13 @@ public class NotificationGroupManager { Notification notif = sbn.getNotification(); String groupKey = sbn.getGroupKey(); final NotificationGroup group = mGroupMap.get(groupKey); + if (group == null) { + // When an app posts 2 different notifications as summary of the same group, then a + // cancellation of the first notification removes this group. + // This situation is not supported and we will not allow such notifications anymore in + // the close future. See b/23676310 for reference. + return; + } if (notif.isGroupSummary()) { group.summary = null; } else {