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
This commit is contained in:
Aaron Liu
2023-06-27 16:32:44 -07:00
parent ab1f8f0f80
commit a9d91a8e87

View File

@@ -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.