From 8f1295a7905d3bd34c0d7871ed0464b0d757b5ff Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Wed, 27 Apr 2022 14:43:48 -0400 Subject: [PATCH] Use correct groupKey API for notif groups Fixes: 222146955 Test: manual Change-Id: I632a13274df55663ce438b7b86ccb16dfee62838 --- .../collection/ShadeListBuilder.java | 10 +++++----- .../collection/ShadeListBuilderTest.java | 19 ------------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java index 51af9559eda29..6f65131ba452c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java @@ -709,8 +709,8 @@ public class ShadeListBuilder implements Dumpable { new ArraySet<>(groupsWithChildrenLostToStability); // Any group which lost a child to filtering or promotion is exempt from having its summary // promoted when it has no attached children. - getGroupsWithChildrenLostToFiltering(groupsExemptFromSummaryPromotion); - getGroupsWithChildrenLostToPromotion(shadeList, groupsExemptFromSummaryPromotion); + addGroupsWithChildrenLostToFiltering(groupsExemptFromSummaryPromotion); + addGroupsWithChildrenLostToPromotion(shadeList, groupsExemptFromSummaryPromotion); // Iterate backwards, so that we can remove elements without affecting indices of // yet-to-be-accessed entries. @@ -865,7 +865,7 @@ public class ShadeListBuilder implements Dumpable { * * These groups will be exempt from appearing without any children. */ - private void getGroupsWithChildrenLostToPromotion(List shadeList, Set out) { + private void addGroupsWithChildrenLostToPromotion(List shadeList, Set out) { for (int i = 0; i < shadeList.size(); i++) { final ListEntry tle = shadeList.get(i); if (tle.getAttachState().getPromoter() != null) { @@ -882,13 +882,13 @@ public class ShadeListBuilder implements Dumpable { * * These groups will be exempt from appearing without any children. */ - private void getGroupsWithChildrenLostToFiltering(Set out) { + private void addGroupsWithChildrenLostToFiltering(Set out) { for (ListEntry tle : mAllEntries) { StatusBarNotification sbn = tle.getRepresentativeEntry().getSbn(); if (sbn.isGroup() && !sbn.getNotification().isGroupSummary() && tle.getAttachState().getExcludingFilter() != null) { - out.add(sbn.getGroup()); + out.add(sbn.getGroupKey()); } } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilderTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilderTest.java index 7638452eaf905..9c12c5c7e2d6a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilderTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilderTest.java @@ -1488,25 +1488,6 @@ public class ShadeListBuilderTest extends SysuiTestCase { ); } - @Test - public void testFinalizeFilteredChildrenPromotesSummary() { - // GIVEN a group with only one child was already drawn - addGroupSummary(0, PACKAGE_1, GROUP_1); - addGroupChild(1, PACKAGE_1, GROUP_1); - addGroupChild(2, PACKAGE_1, GROUP_1); - - // WHEN the parent is filtered out at the finalize step - mFinalizeFilter.mIndicesToFilter.add(1); - mFinalizeFilter.mIndicesToFilter.add(2); - - dispatchBuild(); - - // THEN the children should be promoted to the top level - verifyBuiltList( - notif(0) - ); - } - @Test public void testFinalizeFilteredChildPromotesSibling() { // GIVEN a group with only one child was already drawn