From a9d91a8e87ab70dd13456614ea37e3e0c288e048 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Tue, 27 Jun 2023 16:32:44 -0700 Subject: [PATCH] Look for the correct lock icon view. It seems that the lock icon view controller is instantiated before the view configurator removes the view. If the migrate lock icon flag is off, findViewById in notification panel view intead. Fixes: 289133156 Test: view lock screen with MIGRATE_LOCK_ICON flag on and off. Change-Id: I0a79ac21228c7e954606cf5e2820d070d80271d0 --- .../src/com/android/systemui/shade/ShadeModule.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt index 0500a5844155f..8ae9e5e1fb8cd 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeModule.kt @@ -215,9 +215,15 @@ abstract class ShadeModule { @Provides @SysUISingleton fun providesLockIconView( - notificationShadeWindowView: NotificationShadeWindowView, + keyguardRootView: KeyguardRootView, + notificationPanelView: NotificationPanelView, + featureFlags: FeatureFlags ): LockIconView { - return notificationShadeWindowView.findViewById(R.id.lock_icon_view) + if (featureFlags.isEnabled(Flags.MIGRATE_LOCK_ICON)) { + return keyguardRootView.findViewById(R.id.lock_icon_view) + } else { + return notificationPanelView.findViewById(R.id.lock_icon_view) + } } // TODO(b/277762009): Only allow this view's controller to inject the view. See above.