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

Commit 6653a39d authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Add bouncer state to KeyguardStateController; disable smartspace...

Merge "Add bouncer state to KeyguardStateController; disable smartspace transition if bouncer is showing." into tm-dev am: 806a5efe am: c3ecc39a am: 9f26ce49 am: 04311ee9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18096688



Change-Id: I51ff587a92fc18b0974d85204a45862ea71b682d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7cdeb1c4 04311ee9
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -75,12 +75,6 @@ public interface ViewMediatorCallback {
     */
    void playTrustedSound();

    /**
     * When the bouncer is shown or hides
     * @param shown
     */
    void onBouncerVisiblityChanged(boolean shown);

    /**
     * @return true if the screen is on
     */
+5 −0
Original line number Diff line number Diff line
@@ -813,6 +813,11 @@ class KeyguardUnlockAnimationController @Inject constructor(
            return false
        }

        // The smartspace is not visible if the bouncer is showing, so don't shared element it.
        if (keyguardStateController.isBouncerShowing) {
            return false
        }

        // We started to swipe to dismiss, but now we're doing a fling animation to complete the
        // dismiss. In this case, the smartspace swiped away with the rest of the keyguard, so don't
        // do the shared element transition.
+14 −10
Original line number Diff line number Diff line
@@ -778,16 +778,6 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
            mKeyguardViewControllerLazy.get().onCancelClicked();
        }

        @Override
        public void onBouncerVisiblityChanged(boolean shown) {
            synchronized (KeyguardViewMediator.this) {
                if (shown) {
                    mPendingPinLock = false;
                }
                adjustStatusBarLocked(shown, false);
            }
        }

        @Override
        public void playTrustedSound() {
            KeyguardViewMediator.this.playTrustedSound();
@@ -989,6 +979,19 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
    private DozeParameters mDozeParameters;

    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardStateController.Callback mKeyguardStateControllerCallback =
            new KeyguardStateController.Callback() {
        @Override
        public void onBouncerShowingChanged() {
            synchronized (KeyguardViewMediator.this) {
                if (mKeyguardStateController.isBouncerShowing()) {
                    mPendingPinLock = false;
                }
                adjustStatusBarLocked(mKeyguardStateController.isBouncerShowing(), false);
            }
        }
    };

    private final Lazy<KeyguardUnlockAnimationController> mKeyguardUnlockAnimationControllerLazy;
    private final InteractionJankMonitor mInteractionJankMonitor;
    private boolean mWallpaperSupportsAmbientMode;
@@ -1059,6 +1062,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
        statusBarStateController.addCallback(this);

        mKeyguardStateController = keyguardStateController;
        keyguardStateController.addCallback(mKeyguardStateControllerCallback);
        mKeyguardUnlockAnimationControllerLazy = keyguardUnlockAnimationControllerLazy;
        mScreenOffAnimationController = screenOffAnimationController;
        mInteractionJankMonitor = interactionJankMonitor;
+2 −2
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ public class KeyguardBouncer {
                DejankUtils.postAfterTraversal(mShowRunnable);
            }

            mCallback.onBouncerVisiblityChanged(true /* shown */);
            mKeyguardStateController.notifyBouncerShowing(true /* showing */);
            dispatchStartingToShow();
        } finally {
            Trace.endSection();
@@ -334,7 +334,7 @@ public class KeyguardBouncer {
        }
        mIsScrimmed = false;
        mFalsingCollector.onBouncerHidden();
        mCallback.onBouncerVisiblityChanged(false /* shown */);
        mKeyguardStateController.notifyBouncerShowing(false /* showing */);
        cancelShowRunnable();
        if (mKeyguardViewController != null) {
            mKeyguardViewController.cancelDismissAction();
+12 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ public interface KeyguardStateController extends CallbackController<Callback> {
     */
    boolean isShowing();

    /**
     * Whether the bouncer (PIN/password entry) is currently visible.
     */
    boolean isBouncerShowing();

    /**
     * If swiping up will unlock without asking for a password.
     * @see #isUnlocked()
@@ -186,6 +191,8 @@ public interface KeyguardStateController extends CallbackController<Callback> {
    default void notifyKeyguardDoneFading() {}
    /** **/
    default void notifyKeyguardState(boolean showing, boolean occluded) {}
    /** **/
    default void notifyBouncerShowing(boolean showing) {}

    /**
     * Updates the keyguard state to reflect that it's in the process of being dismissed, either by
@@ -230,6 +237,11 @@ public interface KeyguardStateController extends CallbackController<Callback> {
         */
        default void onKeyguardShowingChanged() {}

        /**
         * Called when the bouncer (PIN/password entry) is shown or hidden.
         */
        default void onBouncerShowingChanged() {}

        /**
         * Triggered when the device was just unlocked and the lock screen is being dismissed.
         */
Loading