Fixed a crash with autobundle grouping
Bug: 27997570
Change-Id: I4ec0e312583ddba0ba944aaa6f221cdda22c64dc
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index 7ca7d12..e25f9de 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 @@
return mOnKeyguard;
}
+ public void removeAllChildren() {
+ List<ExpandableNotificationRow> notificationChildren
+ = mChildrenContainer.getNotificationChildren();
+ ArrayList<ExpandableNotificationRow> 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);
}