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

Commit 1a155d26 authored by Steve Elliott's avatar Steve Elliott
Browse files

Fix IndexOOBException when adding icons to NIC

This eliminates the indices entirely; they are unnecessary, and all
child Views will be moved to the correct index at a later time.

Specifically, the index that was used was not related to the actual
correct index of the child View; it was leftover from a former version
of the algorithm.

Flag: ACONFIG com.android.systemui.notifications_icon_container_refactor STAGING
Fixes: 317342982
Test: atest SystemUITests
Change-Id: I918bfe9c5ce4353ed164b1b96e7b3bd07bd88fa0
parent 03a789aa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ object NotificationIconContainerViewBinder {

                // Add and bind.
                val toAdd: Sequence<String> = iconsDiff.added.asSequence() + failedBindings.toList()
                for ((idx, notifKey) in toAdd.withIndex()) {
                for (notifKey in toAdd) {
                    // Lookup the StatusBarIconView from the store.
                    val sbiv = viewStore.iconView(notifKey)
                    if (sbiv == null) {
@@ -256,7 +256,7 @@ object NotificationIconContainerViewBinder {
                        // added again.
                        removeTransientView(sbiv)
                    }
                    view.addView(sbiv, idx)
                    view.addView(sbiv)
                    boundViewsByNotifKey.remove(notifKey)?.second?.cancel()
                    boundViewsByNotifKey[notifKey] =
                        Pair(