diff options
| author | 2023-08-21 12:11:11 -0700 | |
|---|---|---|
| committer | 2023-08-29 08:05:46 -0700 | |
| commit | 045f04c5e639d51b490ff450ae7de4fca6caafe0 (patch) | |
| tree | cf22cba545d22aca169f25a3985275d37ae84cc8 | |
| parent | ee7b8a36b03866051a2c27c116549779c064b4b7 (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt index e254d5f6d90a..30f2e758eb9a 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt @@ -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 = |