From 50e7467eb6688a37d7877aaf2c9389a7b4a62abc Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 5 May 2016 15:58:10 -0400 Subject: [PATCH] Fixed a bug where the statusbar could become empty Because fullscreen intent notifications could suddenly become children. Change-Id: I2eb8f2bf671b5d039ac3493f281debbe730dc828 Fixes: 28166429 --- .../statusbar/phone/NotificationGroupManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 a51ee4df7ec38..9778a3a55c7ce 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java @@ -119,11 +119,22 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged group.expanded = added.row.areChildrenExpanded(); updateSuppression(group); if (!group.children.isEmpty()) { + HashSet childrenCopy = + (HashSet) group.children.clone(); + for (NotificationData.Entry child : childrenCopy) { + onEntryBecomingChild(child); + } mListener.onGroupCreatedFromChildren(group); } } } + private void onEntryBecomingChild(NotificationData.Entry entry) { + if (entry.row.isHeadsUp()) { + onHeadsUpStateChanged(entry, true); + } + } + public void onEntryBundlingUpdated(final NotificationData.Entry updated, final String overrideGroupKey) { final StatusBarNotification oldSbn = updated.notification.clone(); @@ -188,6 +199,8 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged updateSuppression(mGroupMap.get(oldKey)); updateSuppression(mGroupMap.get(newKey)); } + } else if (!isGroupChild(oldNotification) && isGroupChild(entry.notification)) { + onEntryBecomingChild(entry); } } @@ -354,7 +367,6 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged mListener.onGroupsChanged(); } else { handleSuppressedSummaryHeadsUpped(entry); - } } else { if (mIsolatedEntries.containsKey(sbn.getKey())) {