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

Commit 390f1b9a authored by Selim Cinek's avatar Selim Cinek
Browse files

Improved the unlock animation when bypassing

Previously we were not using the subtle animtion
when going to a wallpaper, which resulted in a bigger
transition. Additionally are we now blocking the lock icon transitions
while we are unlocking with bypass.

Bug: 134952761
Test: atest SystemUITests
Change-Id: I9507bdbac018712cd880cbcc8dd6ee5a56172eae
parent 3b077cbf
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    private boolean mPulsing;
    private boolean mDozing;
    private boolean mDocked;
    private boolean mBlockUpdates;
    private int mIconColor;
    private float mDozeAmount;
    private boolean mBouncerShowing;
@@ -104,8 +105,22 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            new KeyguardMonitor.Callback() {
                @Override
                public void onKeyguardShowingChanged() {
                    boolean force = false;
                    boolean wasShowing = mKeyguardShowing;
                    mKeyguardShowing = mKeyguardMonitor.isShowing();
                    update();
                    if (!wasShowing && mKeyguardShowing && mBlockUpdates) {
                        mBlockUpdates = false;
                        force = true;
                    }
                    update(force);
                }

                @Override
                public void onKeyguardFadingAwayChanged() {
                    if (!mKeyguardMonitor.isKeyguardFadingAway() && mBlockUpdates) {
                        mBlockUpdates = false;
                        update(true /* force */);
                    }
                }
            };
    private final DockManager.DockEventListener mDockEventListener =
@@ -256,7 +271,11 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        mIsFaceUnlockState = state == STATE_SCANNING_FACE;
        mLastState = state;

        if (lastState != state || mForceUpdate) {
        boolean shouldUpdate = lastState != state || mForceUpdate;
        if (mBlockUpdates && canBlockUpdates()) {
            shouldUpdate = false;
        }
        if (shouldUpdate) {
            mForceUpdate = false;
            @LockAnimIndex final int lockAnimIndex = getAnimationIndexForTransition(lastState,
                    state, mPulsing, mDozing);
@@ -323,6 +342,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        return true;
    }

    private boolean canBlockUpdates() {
        return mKeyguardShowing || mKeyguardMonitor.isKeyguardFadingAway();
    }

    private void updateClickability() {
        if (mAccessibilityController == null) {
            return;
@@ -529,11 +552,17 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    /**
     * We need to hide the lock whenever there's a fingerprint unlock, otherwise you'll see the
     * icon on top of the black front scrim.
     * @param wakeAndUnlock are we wake and unlocking
     * @param isUnlock are we currently unlocking
     */
    public void onBiometricAuthModeChanged(boolean wakeAndUnlock) {
    public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock) {
        if (wakeAndUnlock) {
            mWakeAndUnlockRunning = true;
        }
        if (isUnlock && mBypassController.getBypassEnabled() && canBlockUpdates()) {
            // We don't want the icon to change while we are unlocking
            mBlockUpdates = true;
        }
        update();
    }

+2 −1
Original line number Diff line number Diff line
@@ -3826,7 +3826,8 @@ public class StatusBar extends SystemUI implements DemoMode,
    public void notifyBiometricAuthModeChanged() {
        updateDozing();
        updateScrimController();
        mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock());
        mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock(),
                mBiometricUnlockController.isBiometricUnlock());
    }

    @VisibleForTesting
+1 −1
Original line number Diff line number Diff line
@@ -814,7 +814,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     */
    public boolean shouldSubtleWindowAnimationsForUnlock() {
        return mStatusBar.mKeyguardBypassController.getBypassEnabled()
                && mStatusBar.mState == StatusBarState.KEYGUARD;
                && mStatusBar.mState == StatusBarState.KEYGUARD && !mBouncer.isAnimatingAway();
    }

    public boolean isGoingToNotificationShade() {
+3 −2
Original line number Diff line number Diff line
@@ -272,10 +272,11 @@ public class StatusBarWindowView extends FrameLayout {
    /**
     * Called when the biometric authentication mode changes.
     * @param wakeAndUnlock If the type is {@link BiometricUnlockController#isWakeAndUnlock()}
     * @param isUnlock If the type is {@link BiometricUnlockController#isBiometricUnlock()} ()
     */
    public void onBiometricAuthModeChanged(boolean wakeAndUnlock) {
    public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock) {
        if (mLockIcon != null) {
            mLockIcon.onBiometricAuthModeChanged(wakeAndUnlock);
            mLockIcon.onBiometricAuthModeChanged(wakeAndUnlock, isUnlock);
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -50,5 +50,6 @@ public interface KeyguardMonitor extends CallbackController<Callback> {

    interface Callback {
        void onKeyguardShowingChanged();
        default void onKeyguardFadingAwayChanged() {}
    }
}
Loading