OSDN Git Service

Remove obsolete state
authorLucas Dupin <dupin@google.com>
Fri, 7 Jun 2019 18:44:28 +0000 (11:44 -0700)
committerLucas Dupin <dupin@google.com>
Fri, 7 Jun 2019 18:44:28 +0000 (11:44 -0700)
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

packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java

index 3143971..07436f8 100644 (file)
@@ -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
@@ -126,18 +121,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) {
                     boolean oldSimLocked = mSimLocked;
@@ -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;
         }