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

Commit b064bd5e authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Improved the unlock animation when bypassing" into qt-r1-dev am: 16815264

am: 75e223f5

Change-Id: I88ae49e8b027b6ee66704953f8fe4b1af12b9049
parents e513ce07 75e223f5
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
@@ -95,6 +95,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 mBouncerShowingScrimmed;
@@ -107,8 +108,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 =
@@ -261,7 +276,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);
@@ -330,6 +349,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        return true;
    }

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

    private void updateClickability() {
        if (mAccessibilityController == null) {
            return;
@@ -536,11 +559,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
@@ -3834,7 +3834,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