diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-11-11 16:59:12 +0100 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-11-12 15:02:33 +0100 |
commit | f8d77da969edc2f191d349f7d9a30d02edcbd388 (patch) | |
tree | 3e15338d2d5aee43b9ec18f2c36abf300c9e0212 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | d6f440e0fff6c76dffacacf9d054124b7e9a6ce4 (diff) | |
download | frameworks_base-f8d77da969edc2f191d349f7d9a30d02edcbd388.zip frameworks_base-f8d77da969edc2f191d349f7d9a30d02edcbd388.tar.gz frameworks_base-f8d77da969edc2f191d349f7d9a30d02edcbd388.tar.bz2 |
Improve lockscreen launch animations
- Add a timeout so if WindowManager "forgets" to tell that the
activity has drawn, we still unlock after 3 seconds, so the user
is not completely stuck.
- Use the screen height instead of the window height for the
translation animation.
- Don't run the animation if the attached window is not null. The
animation from the attached window will influence the transformation
as well, so there is no need to run an additional animation in this
case (apps with SurfaceView's had broken unlock transitions because
of this).
- If the starting window needs to go away while the unlock transition
is running, modify the existing animation such that it fades out in
the same transition.
Bug: 15991916
Change-Id: Ia5dfa31e1bc0d5745fe228e1daf08e268733b6f1
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 7ca8fc1..20e418c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -113,6 +113,8 @@ import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT; */ public class KeyguardViewMediator extends SystemUI { private static final int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000; + private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000; + final static boolean DEBUG = false; private final static boolean DBG_WAKE = false; @@ -136,6 +138,7 @@ public class KeyguardViewMediator extends SystemUI { private static final int DISMISS = 17; private static final int START_KEYGUARD_EXIT_ANIM = 18; private static final int ON_ACTIVITY_DRAWN = 19; + private static final int KEYGUARD_DONE_PENDING_TIMEOUT = 20; /** * The default amount of time we stay awake (used for all key input) @@ -294,7 +297,7 @@ public class KeyguardViewMediator extends SystemUI { // ActivityManagerService) will not reconstruct the keyguard if it is already showing. synchronized (KeyguardViewMediator.this) { mSwitchingUser = true; - mKeyguardDonePending = false; + resetKeyguardDonePendingLocked(); resetStateLocked(); adjustStatusBarLocked(); // When we switch users we want to bring the new user to the biometric unlock even @@ -450,6 +453,8 @@ public class KeyguardViewMediator extends SystemUI { mKeyguardDonePending = true; mHideAnimationRun = true; mStatusBarKeyguardViewManager.startPreHideAnimation(null /* finishRunnable */); + mHandler.sendEmptyMessageDelayed(KEYGUARD_DONE_PENDING_TIMEOUT, + KEYGUARD_DONE_PENDING_TIMEOUT_MS); } @Override @@ -584,7 +589,7 @@ public class KeyguardViewMediator extends SystemUI { mScreenOn = false; if (DEBUG) Log.d(TAG, "onScreenTurnedOff(" + why + ")"); - mKeyguardDonePending = false; + resetKeyguardDonePendingLocked(); mHideAnimationRun = false; // Lock immediately based on setting if secure (user has a pin/pattern/password). @@ -1108,6 +1113,9 @@ public class KeyguardViewMediator extends SystemUI { StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj; handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration); break; + case KEYGUARD_DONE_PENDING_TIMEOUT: + Log.w(TAG, "Timeout while waiting for activity drawn!"); + // Fall through. case ON_ACTIVITY_DRAWN: handleOnActivityDrawn(); break; @@ -1122,7 +1130,7 @@ public class KeyguardViewMediator extends SystemUI { private void handleKeyguardDone(boolean authenticated, boolean wakeup) { if (DEBUG) Log.d(TAG, "handleKeyguardDone"); synchronized (this) { - mKeyguardDonePending = false; + resetKeyguardDonePendingLocked(); } if (authenticated) { @@ -1242,7 +1250,7 @@ public class KeyguardViewMediator extends SystemUI { mStatusBarKeyguardViewManager.show(options); mHiding = false; mShowing = true; - mKeyguardDonePending = false; + resetKeyguardDonePendingLocked(); mHideAnimationRun = false; updateActivityLockScreenState(); adjustStatusBarLocked(); @@ -1321,7 +1329,7 @@ public class KeyguardViewMediator extends SystemUI { mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); mShowing = false; - mKeyguardDonePending = false; + resetKeyguardDonePendingLocked(); mHideAnimationRun = false; updateActivityLockScreenState(); adjustStatusBarLocked(); @@ -1417,6 +1425,11 @@ public class KeyguardViewMediator extends SystemUI { && mSearchManager.getAssistIntent(mContext, false, UserHandle.USER_CURRENT) != null; } + private void resetKeyguardDonePendingLocked() { + mKeyguardDonePending = false; + mHandler.removeMessages(KEYGUARD_DONE_PENDING_TIMEOUT); + } + public void onBootCompleted() { mUpdateMonitor.dispatchBootCompleted(); synchronized (this) { |