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

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

Fix IOOB when stabilizing bundle group children

Fixes: 417981398
Flag: com.android.systemui.notification_bundle_ui
Test: manual
  1. have existing group inside of a bundle
  2. open shade, expand bundle
  3. receive new child notification in group
  Observe: no crash
Change-Id: I455ffbfdcb59e0f5ba34d8b3700fcf6480f70b69
parent 0ebfb805
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -803,8 +803,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
                // maybe put bundle children back into their old parents (including moving back to
                // maybe put bundle children back into their old parents (including moving back to
                // top-level)
                // top-level)
                final List<ListEntry> bundleChildren = bundleEntry.getRawChildren();
                final List<ListEntry> bundleChildren = bundleEntry.getRawChildren();
                final int bundleSize = bundleChildren.size();
                for (int j = 0; j < bundleChildren.size(); j++) {
                for (int j = 0; j < bundleSize; j++) {
                    final ListEntry child = bundleChildren.get(j);
                    final ListEntry child = bundleChildren.get(j);
                    if (maybeSuppressParentChange(child, topLevelList)) {
                    if (maybeSuppressParentChange(child, topLevelList)) {
                        bundleChildren.remove(j);
                        bundleChildren.remove(j);
@@ -814,8 +813,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable {
                        // maybe put group children back into their old parents (including moving
                        // maybe put group children back into their old parents (including moving
                        // back to top-level)
                        // back to top-level)
                        final List<NotificationEntry> groupChildren = groupEntry.getRawChildren();
                        final List<NotificationEntry> groupChildren = groupEntry.getRawChildren();
                        final int groupSize = groupChildren.size();
                        for (int k = 0; k < groupChildren.size(); k++) {
                        for (int k = 0; k < groupSize; k++) {
                            if (maybeSuppressParentChange(groupChildren.get(k), topLevelList)) {
                            if (maybeSuppressParentChange(groupChildren.get(k), topLevelList)) {
                                // child was put back into its previous parent, so we remove it from
                                // child was put back into its previous parent, so we remove it from
                                // this group
                                // this group