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

Commit 9b469e03 authored by Chris Göllner's avatar Chris Göllner
Browse files

Fix status bar crashing on connected displays

Currently if we try to bind the notification icons for all displays,
there is a crash, because the same notification icon view can't have
multiple parents.

Bug: 369337701
Test: Manually - Enable `status_bar_connected_displays` and `status_bar_simple_fragment`
Flag: com.android.systemui.status_bar_simple_fragment
Change-Id: Iba887b0696d0c1007ebc32af2926b5be1de38693
parent 1468a5f3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.statusbar.pipeline.shared.ui.composable

import android.view.Display
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -152,9 +153,15 @@ fun StatusBarRoot(
                        phoneStatusBarView.requireViewById<NotificationIconContainer>(
                            R.id.notificationIcons
                        )

                    // TODO(b/369337701): implement notification icons for all displays.
                    //  Currently if we try to bind for all displays, there is a crash, because the
                    //  same notification icon view can't have multiple parents.
                    if (context.displayId == Display.DEFAULT_DISPLAY) {
                        scope.launch {
                            notificationIconsBinder.bindWhileAttached(notificationIconContainer)
                        }
                    }

                    // This binder handles everything else
                    scope.launch {