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

Commit 5941ae08 authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Show bouncer when needed." into main

parents c7b314bd ff0df2ec
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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,
+30 −5
Original line number Diff line number Diff line
@@ -662,8 +662,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
         * show if any subsequent events are to be handled.
         */
        if (beginShowingBouncer(event)) {
            if (SceneContainerFlag.isEnabled()) {
                mSceneInteractorLazy.get().changeScene(
                        Scenes.Bouncer, "StatusBarKeyguardViewManager.onPanelExpansionChanged");
            } else {
                mPrimaryBouncerInteractor.show(/* isScrimmed= */false);
            }
        }

        if (!primaryBouncerIsOrWillBeShowing()) {
            return;
@@ -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,8 +788,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    public void showPrimaryBouncer(boolean scrimmed) {
        hideAlternateBouncer(false);
        if (mKeyguardStateController.isShowing() && !isBouncerShowing()) {
            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
                    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);
                    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;