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

Commit a30ee7fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "assign stable indices to bundles and children" into main

parents ebe6e452 ff1874ce
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++);
                        }
                    }
                }
            }
        }
    }