diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-06-17 15:04:47 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-06-17 15:28:05 -0700 |
commit | 53c68a44acbd9343dda648c17652e921c28fda1d (patch) | |
tree | 43f69c8ee631c1f67bf118582b79e9a9be63e6ff | |
parent | 1f681448c6b7db451c31af7d61c0b85b7b5af04f (diff) | |
download | frameworks_base-53c68a44acbd9343dda648c17652e921c28fda1d.zip frameworks_base-53c68a44acbd9343dda648c17652e921c28fda1d.tar.gz frameworks_base-53c68a44acbd9343dda648c17652e921c28fda1d.tar.bz2 |
Fix bug when Keyguard gets hidden.
We make sure in Keyguard that we only hide ourselves in
startKeyguardExitAnimation ourselves when we requested a hide.
In addition, this change also fixes a bug in WindowAnimator that
it should only call startKeyguardExitAnimation when Keyguard actually
requested a hide.
Bug: 15676717
Change-Id: I2279cccb9916985b7e9a2f41137878be5782cb9c
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 14 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowAnimator.java | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index ffd76a7..b9e2e1b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -239,6 +239,12 @@ public class KeyguardViewMediator extends SystemUI { private String mPhoneState = TelephonyManager.EXTRA_STATE_IDLE; /** + * Whether a hide is pending an we are just waiting for #startKeyguardExitAnimation to be + * called. + * */ + private boolean mHiding; + + /** * we send this intent when the keyguard is dismissed. */ private static final Intent USER_PRESENT_INTENT = new Intent(Intent.ACTION_USER_PRESENT) @@ -1169,6 +1175,7 @@ public class KeyguardViewMediator extends SystemUI { } mStatusBarKeyguardViewManager.show(options); + mHiding = false; mShowing = true; mKeyguardDonePending = false; updateActivityLockScreenState(); @@ -1191,7 +1198,7 @@ public class KeyguardViewMediator extends SystemUI { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleHide"); try { - + mHiding = true; if (mShowing) { // Don't actually hide the Keyguard at the moment, wait for window manager until @@ -1212,6 +1219,11 @@ public class KeyguardViewMediator extends SystemUI { private void handleStartKeyguardExitAnimation(long startTime, long fadeoutDuration) { synchronized (KeyguardViewMediator.this) { + if (!mHiding) { + return; + } + mHiding = false; + // only play "unlock" noises if not on a call (since the incall UI // disables the keyguard) if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) { diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 45326f7..f1d0585 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -391,7 +391,7 @@ public class WindowAnimator { final WindowStateAnimator winAnimator = unForceHiding.get(i); winAnimator.setAnimation(a); winAnimator.mAnimationIsEntrance = true; - if (startKeyguardExit) { + if (startKeyguardExit && mKeyguardGoingAway) { // Do one time only. mPolicy.startKeyguardExitAnimation(mCurrentTime + a.getStartOffset(), a.getDuration()); |