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

Commit de8c25ac authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Remove obsolete state

There isn't a fingerprint animation, we don't need the timeout anymore.
This event was triggering unwanted updates, cancelling animations
during wake-up.

Fixes: 134448130
Test: power to wake-up: observe animation
Test: fingerprint from bouncer: observe animation
Test: fingerprint to wake-up: no animation
Change-Id: I17fcd9eb5eba7e7bc88de09309f5c310fe13433f
parent 37c7eb8b
Loading
Loading
Loading
Loading
+1 −27
Original line number Diff line number Diff line
@@ -66,8 +66,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener,
        UnlockMethodCache.OnUnlockMethodChangedListener {

    private static final int FP_DRAW_OFF_TIMEOUT = 800;

    private static final int STATE_LOCKED = 0;
    private static final int STATE_LOCK_OPEN = 1;
    private static final int STATE_SCANNING_FACE = 2;
@@ -83,8 +81,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange

    private int mLastState = 0;
    private boolean mTransientBiometricsError;
    private boolean mScreenOn;
    private boolean mLastScreenOn;
    private boolean mIsFaceUnlockState;
    private boolean mSimLocked;
    private int mDensity;
@@ -109,7 +105,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
                    update(false /* force */);
                }
            };
    private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */);
    private final DockManager.DockEventListener mDockEventListener =
            new DockManager.DockEventListener() {
                @Override
@@ -125,18 +120,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange

    private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
            new KeyguardUpdateMonitorCallback() {
                @Override
                public void onScreenTurnedOn() {
                    mScreenOn = true;
                    update();
                }

                @Override
                public void onScreenTurnedOff() {
                    mScreenOn = false;
                    update();
                }

                @Override
                public void onSimStateChanged(int subId, int slotId,
                        IccCardConstants.State simState) {
@@ -249,8 +232,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    public void update(boolean force) {
        int state = getState();
        mIsFaceUnlockState = state == STATE_SCANNING_FACE;
        if (state != mLastState || mLastDozing != mDozing || mLastPulsing != mPulsing
                || mLastScreenOn != mScreenOn || force) {
        if (state != mLastState || mLastDozing != mDozing || mLastPulsing != mPulsing || force) {
            @LockAnimIndex final int lockAnimIndex = getAnimationIndexForTransition(mLastState,
                    state, mLastPulsing, mPulsing, mLastDozing, mDozing);
            boolean isAnim = lockAnimIndex != -1;
@@ -289,15 +271,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            }
            updateDarkTint();

            if (isAnim && !mLastScreenOn) {
                removeCallbacks(mDrawOffTimeout);
                postDelayed(mDrawOffTimeout, FP_DRAW_OFF_TIMEOUT);
            } else {
                removeCallbacks(mDrawOffTimeout);
            }

            mLastState = state;
            mLastScreenOn = mScreenOn;
            mLastDozing = mDozing;
            mLastPulsing = mPulsing;
        }