From c1e389dadc234827354b95bac98a9c7146ed301c Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 7 Apr 2016 11:02:57 -0700 Subject: [PATCH] Fixed a crash with autobundle grouping Bug: 27997570 Change-Id: I4ec0e312583ddba0ba944aaa6f221cdda22c64dc --- .../statusbar/ExpandableNotificationRow.java | 13 +++++++++++++ .../systemui/statusbar/phone/PhoneStatusBar.java | 3 +++ 2 files changed, 16 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 7ca7d12c590a7..e25f9decd2565 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -618,6 +618,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return mOnKeyguard; } + public void removeAllChildren() { + List notificationChildren + = mChildrenContainer.getNotificationChildren(); + ArrayList clonedList = new ArrayList<>(notificationChildren); + for (int i = 0; i < clonedList.size(); i++) { + ExpandableNotificationRow row = clonedList.get(i); + mChildrenContainer.removeNotification(row); + mHeaderUtil.restoreNotificationHeader(row); + row.setIsChildInGroup(false, null); + } + onChildrenCountChanged(); + } + public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index c563eb6066636..99913f2b20916 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1526,6 +1526,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // we are only transfering this notification to its parent, don't generate an animation mStackScroller.setChildTransferInProgress(true); } + if (remove.isSummaryWithChildren()) { + remove.removeAllChildren(); + } mStackScroller.removeView(remove); mStackScroller.setChildTransferInProgress(false); }