commit | 697c39867bd90d03289711b14c13bc39c4a7c6a7 | [log] [tgz] |
---|---|---|
author | Steve Elliott <steell@google.com> | Mon Feb 12 10:59:04 2024 -0500 |
committer | Steve Elliott <steell@google.com> | Mon Feb 12 19:28:57 2024 +0000 |
tree | c3ab64e0e342a886278948feb04d69133accdc14 | |
parent | e9ff7d3aac325b09ab7c2e4e33731f135cfbad34 [diff] |
Fix potential IOOB error in icon reordering Flag: ACONFIG com.android.systemui.notifications_icon_container_refactor TRUNKFOOD Bug: 322852228 Test: atest SystemUITests Change-Id: I9f59666fcf3e56402c817add9b52608b243816ad
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt index de3a626..c8d6abe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt
@@ -311,12 +311,13 @@ boundViewsByNotifKey[it.notifKey]?.first } val childCount = view.childCount + val toRemove = mutableListOf<View>() for (i in 0 until childCount) { val actual = view.getChildAt(i) val expected = expectedChildren.getOrNull(i) if (expected == null) { Log.wtf(TAG, "[$logTag] Unexpected child $actual") - view.removeView(actual) + toRemove.add(actual) continue } if (actual === expected) { @@ -325,6 +326,9 @@ view.removeView(expected) view.addView(expected, i) } + for (child in toRemove) { + view.removeView(child) + } } } }