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

Commit ff1874ce authored by Steve Elliott's avatar Steve Elliott
Browse files

assign stable indices to bundles and children

Bug: 395698521
Test: atest SystemUITests
Flag: com.android.systemui.notification_bundle_ui
Change-Id: I95f8527efae8e7ae2df1933454ee9c766fdb9b6e
parent f8893543
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -1339,8 +1339,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
                currentSection = section;
            }
            entry.getAttachState().setStableIndex(sectionMemberIndex++);
            if (entry instanceof GroupEntry) {
                final GroupEntry parent = (GroupEntry) entry;
            if (entry instanceof GroupEntry parent) {
                final NotificationEntry summary = parent.getSummary();
                if (summary != null) {
                    summary.getAttachState().setStableIndex(sectionMemberIndex++);
@@ -1349,7 +1348,18 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
                    child.getAttachState().setStableIndex(sectionMemberIndex++);
                }
            } else if (entry instanceof BundleEntry bundleEntry) {
                // TODO(b/395698521): Handle BundleEntry
                for (ListEntry child : bundleEntry.getChildren()) {
                    child.getAttachState().setStableIndex(sectionMemberIndex++);
                    if (child instanceof GroupEntry groupEntry) {
                        final NotificationEntry summary = groupEntry.getSummary();
                        if (summary != null) {
                            summary.getAttachState().setStableIndex(sectionMemberIndex++);
                        }
                        for (NotificationEntry notifEntry : groupEntry.getChildren()) {
                            notifEntry.getAttachState().setStableIndex(sectionMemberIndex++);
                        }
                    }
                }
            }
        }
    }