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

Commit 9aaef7dc authored by Steve Elliott's avatar Steve Elliott
Browse files

Remove failed icon bindings on subsequent success

Flag: ACONFIG com.android.systemui.notifications_icon_container_refactor DEVELOPMENT
Bug: 278765923
Test: manual - test on AOD, status bar, and shelf, verify no crashes
Change-Id: I815e7945fbadaa3951b9b74e55e08401a395aff9
parent aaf37858
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -244,7 +244,7 @@ object NotificationIconContainerViewBinder {
                }
                }


                // Add and bind.
                // Add and bind.
                val toAdd: Sequence<String> = iconsDiff.added.asSequence() + failedBindings
                val toAdd: Sequence<String> = iconsDiff.added.asSequence() + failedBindings.toList()
                for ((idx, notifKey) in toAdd.withIndex()) {
                for ((idx, notifKey) in toAdd.withIndex()) {
                    // Lookup the StatusBarIconView from the store.
                    // Lookup the StatusBarIconView from the store.
                    val sbiv = viewStore.iconView(notifKey)
                    val sbiv = viewStore.iconView(notifKey)
@@ -252,6 +252,7 @@ object NotificationIconContainerViewBinder {
                        failedBindings.add(notifKey)
                        failedBindings.add(notifKey)
                        continue
                        continue
                    }
                    }
                    failedBindings.remove(notifKey)
                    // The view might still be transiently added if it was just removed and added
                    // The view might still be transiently added if it was just removed and added
                    // again
                    // again
                    view.removeTransientView(sbiv)
                    view.removeTransientView(sbiv)