From ff0df2eca8b5eb63febfd1f87100a4f9265e55f5 Mon Sep 17 00:00:00 2001 From: Alejandro Nijamkin Date: Tue, 2 Apr 2024 14:37:11 -0700 Subject: [flexiglass] Show bouncer when needed. Hooks up the legacy StatusBarKeyguardViewManager to switch to the bouncer scene if Flexiglass is enabled when it's told to show the bouncer. Fix: 330670513 Test: manually verified that long-pressing on a QS tile brings up the bouncer and that entering the right credentials then opens up that QS tile's dialog Test: manually verified that touching the QS edit mode button brings up the bouncer. Unfortunately, it crashes with https://paste.googleplex.com/6608650226892800 after the right credentials are entered; a separate bug will be opened for this Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT Change-Id: I05d56d88ae1da0566e955a6846894956f8f432a2 --- .../domain/interactor/PrimaryBouncerInteractor.kt | 5 ++++ .../phone/StatusBarKeyguardViewManager.java | 35 ++++++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) (limited to 'packages/SystemUI') diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt index 893887fad176..d88b3dcac598 100644 --- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt @@ -45,6 +45,7 @@ import com.android.systemui.keyguard.DismissCallbackRegistry import com.android.systemui.keyguard.data.repository.TrustRepository import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R +import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.user.domain.interactor.SelectedUserInteractor @@ -158,6 +159,10 @@ constructor( /** Show the bouncer if necessary and set the relevant states. */ @JvmOverloads fun show(isScrimmed: Boolean) { + // When the scene container framework is enabled, instead of calling this, call + // SceneInteractor#changeScene(Scenes.Bouncer, ...). + SceneContainerFlag.assertInLegacyMode() + if (primaryBouncerView.delegate == null && !Flags.composeBouncer()) { Log.d( TAG, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index afd2415ad7a8..5f26702ad867 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -662,7 +662,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * show if any subsequent events are to be handled. */ if (beginShowingBouncer(event)) { - mPrimaryBouncerInteractor.show(/* isScrimmed= */false); + if (SceneContainerFlag.isEnabled()) { + mSceneInteractorLazy.get().changeScene( + Scenes.Bouncer, "StatusBarKeyguardViewManager.onPanelExpansionChanged"); + } else { + mPrimaryBouncerInteractor.show(/* isScrimmed= */false); + } } if (!primaryBouncerIsOrWillBeShowing()) { @@ -716,7 +721,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb // The keyguard might be showing (already). So we need to hide it. if (!primaryBouncerIsShowing()) { mCentralSurfaces.hideKeyguard(); - mPrimaryBouncerInteractor.show(true); + if (SceneContainerFlag.isEnabled()) { + mSceneInteractorLazy.get().changeScene( + Scenes.Bouncer, "StatusBarKeyguardViewManager.showBouncerOrKeyguard"); + } else { + mPrimaryBouncerInteractor.show(/* isScrimmed= */ true); + } } else { Log.e(TAG, "Attempted to show the sim bouncer when it is already showing."); } @@ -778,7 +788,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void showPrimaryBouncer(boolean scrimmed) { hideAlternateBouncer(false); if (mKeyguardStateController.isShowing() && !isBouncerShowing()) { - mPrimaryBouncerInteractor.show(scrimmed); + if (SceneContainerFlag.isEnabled()) { + mSceneInteractorLazy.get().changeScene( + Scenes.Bouncer, "StatusBarKeyguardViewManager.showPrimaryBouncer"); + } else { + mPrimaryBouncerInteractor.show(scrimmed); + } } updateStates(); } @@ -873,13 +888,23 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (afterKeyguardGone) { // we'll handle the dismiss action after keyguard is gone, so just show the // bouncer - mPrimaryBouncerInteractor.show(/* isScrimmed= */true); + if (SceneContainerFlag.isEnabled()) { + mSceneInteractorLazy.get().changeScene( + Scenes.Bouncer, "StatusBarKeyguardViewManager.dismissWithAction"); + } else { + mPrimaryBouncerInteractor.show(/* isScrimmed= */ true); + } } else { // after authentication success, run dismiss action with the option to defer // hiding the keyguard based on the return value of the OnDismissAction mPrimaryBouncerInteractor.setDismissAction( mAfterKeyguardGoneAction, mKeyguardGoneCancelAction); - mPrimaryBouncerInteractor.show(/* isScrimmed= */true); + if (SceneContainerFlag.isEnabled()) { + mSceneInteractorLazy.get().changeScene( + Scenes.Bouncer, "StatusBarKeyguardViewManager.dismissWithAction"); + } else { + mPrimaryBouncerInteractor.show(/* isScrimmed= */ true); + } // bouncer will handle the dismiss action, so we no longer need to track it here mAfterKeyguardGoneAction = null; mKeyguardGoneCancelAction = null; -- cgit v1.2.3-59-g8ed1b