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

Commit 045f04c5 authored by Aaron Liu's avatar Aaron Liu
Browse files

Proactively inflate indication area.

This will prevent NPE when indication controller tries to access view
apis.

Bug: 295555276
Test: test to see that indication area can be set later than view
inflation.

Change-Id: I348164cb224829288dcfd6773a49a9fb41053c43
parent ee7b8a36
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder
import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardSettingsViewBinder
import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea
import com.android.systemui.keyguard.ui.view.KeyguardRootView
import com.android.systemui.keyguard.ui.view.layout.KeyguardBlueprintCommandListener
import com.android.systemui.keyguard.ui.viewmodel.KeyguardAmbientIndicationViewModel
@@ -96,6 +97,7 @@ constructor(
    private val communalWidgetViewAdapter: CommunalWidgetViewAdapter,
    private val notificationStackScrollerLayoutController: NotificationStackScrollLayoutController,
    private val context: Context,
    private val keyguardIndicationController: KeyguardIndicationController,
) : CoreStartable {

    private var rootViewHandle: DisposableHandle? = null
@@ -122,6 +124,7 @@ constructor(
        private set

    override fun start() {
        initializeViews()
        bindKeyguardRootView()
        val notificationPanel =
            notificationShadeWindowView.requireViewById(R.id.notification_panel) as ViewGroup
@@ -183,6 +186,12 @@ constructor(
            )
    }

    /** Initialize views so that corresponding controllers have a view set. */
    private fun initializeViews() {
        val indicationArea = KeyguardIndicationArea(context, null)
        keyguardIndicationController.setIndicationArea(indicationArea)
    }

    private fun bindKeyguardRootView() {
        rootViewHandle?.dispose()
        rootViewHandle =