Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de16879c authored by Steve Elliott's avatar Steve Elliott Committed by Automerger Merge Worker
Browse files

Merge "Use correct groupKey API for notif groups" into tm-dev am: 502a44e1...

Merge "Use correct groupKey API for notif groups" into tm-dev am: 502a44e1 am: 8fd3d60c am: 3ba7dafb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17989540



Change-Id: Iefa4e0e234629cdf0f0b2e21dc728bc75457be6a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6fc83026 3ba7dafb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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<ListEntry> shadeList, Set<String> out) {
    private void addGroupsWithChildrenLostToPromotion(List<ListEntry> shadeList, Set<String> 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<String> out) {
    private void addGroupsWithChildrenLostToFiltering(Set<String> 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());
            }
        }
    }
+0 −19
Original line number Diff line number Diff line
@@ -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