diff options
| author | 2019-07-18 01:08:03 +0000 | |
|---|---|---|
| committer | 2019-07-18 01:08:03 +0000 | |
| commit | 0108bc4b8b942b4524efa8ff33795260f746ca13 (patch) | |
| tree | 9c37f9f6d6843e717f558f832ac5e7c27e227942 | |
| parent | 2a99838c9f8a5de6a7859286fd49e3279e01566b (diff) | |
| parent | 0fdd8f16d1409f4919931dbe8137077003770ea1 (diff) | |
Merge "Do not play "lock" anim right after showing kg" into qt-r1-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java index 49afae7415ae..1360a084207b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -102,6 +102,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange private boolean mWakeAndUnlockRunning; private boolean mKeyguardShowing; private boolean mShowingLaunchAffordance; + private boolean mKeyguardJustShown; private boolean mUpdatePending; private final KeyguardMonitor.Callback mKeyguardMonitorCallback = @@ -115,6 +116,9 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange mBlockUpdates = false; force = true; } + if (!wasShowing && mKeyguardShowing) { + mKeyguardJustShown = true; + } update(force); } @@ -273,8 +277,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange int state = getState(); int lastState = mLastState; + boolean keyguardJustShown = mKeyguardJustShown; mIsFaceUnlockState = state == STATE_SCANNING_FACE; mLastState = state; + mKeyguardJustShown = false; boolean shouldUpdate = lastState != state || mForceUpdate; if (mBlockUpdates && canBlockUpdates()) { @@ -283,7 +289,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange if (shouldUpdate) { mForceUpdate = false; @LockAnimIndex final int lockAnimIndex = getAnimationIndexForTransition(lastState, - state, mPulsing, mDozing); + state, mPulsing, mDozing, keyguardJustShown); boolean isAnim = lockAnimIndex != -1; int iconRes = isAnim ? getThemedAnimationResId(lockAnimIndex) : getIconForState(state); @@ -412,7 +418,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange } private static int getAnimationIndexForTransition(int oldState, int newState, boolean pulsing, - boolean dozing) { + boolean dozing, boolean keyguardJustShown) { // Never animate when screen is off if (dozing && !pulsing) { @@ -423,7 +429,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange return ERROR; } else if (oldState != STATE_LOCK_OPEN && newState == STATE_LOCK_OPEN) { return UNLOCK; - } else if (oldState == STATE_LOCK_OPEN && newState == STATE_LOCKED) { + } else if (oldState == STATE_LOCK_OPEN && newState == STATE_LOCKED && !keyguardJustShown) { return LOCK; } else if (newState == STATE_SCANNING_FACE) { return SCANNING; |