diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-08-11 22:36:20 +0200 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2014-08-12 22:47:52 +0000 |
commit | 8de4311c51229efbe2f2d0afbf298982c5cadd96 (patch) | |
tree | 93189443fcf95e9014b67eb5f037d83baeef67c2 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | 125cf62d596f544db4cb7b314f94c2757f5afaa7 (diff) | |
download | frameworks_base-8de4311c51229efbe2f2d0afbf298982c5cadd96.zip frameworks_base-8de4311c51229efbe2f2d0afbf298982c5cadd96.tar.gz frameworks_base-8de4311c51229efbe2f2d0afbf298982c5cadd96.tar.bz2 |
Lockscreen launch animations
- Get rid of ActivityManager.dismissKeyguardOnNextActivity, which was
used for two different things: Dismiss keyguard from somewhere else
(not really necessary anymore), wait to actually dismiss keyguard
after the window behind is drawn. Instead, introduce
keyguardWaitingForActivityDrawn(), and change the semantics where
necessary.
- Make wallpaper_close_enter consistent with task_open_enter and the
Keyguard launch animation.
- Close the panel even on lockscreen when launching a notification.
- Block notification shade updates during the collapsing motion so
notification don't play the disappear animation immediately after
having launched a notification.
Bug: 15991916
Change-Id: I133c177b84e926c87c1a404ba93d633593fec3ab
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java | 6 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 61 |
2 files changed, 54 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index b280ab7..ee699d2 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -208,6 +208,12 @@ public class KeyguardService extends Service { checkPermission(); mKeyguardViewMediator.startKeyguardExitAnimation(startTime, fadeoutDuration); } + + @Override + public void onActivityDrawn() { + checkPermission(); + mKeyguardViewMediator.onActivityDrawn(); + } }; } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 117515b..e4b395f 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -133,6 +133,7 @@ public class KeyguardViewMediator extends SystemUI { private static final int KEYGUARD_TIMEOUT = 13; private static final int DISMISS = 17; private static final int START_KEYGUARD_EXIT_ANIM = 18; + private static final int ON_ACTIVITY_DRAWN = 19; /** * The default amount of time we stay awake (used for all key input) @@ -256,6 +257,7 @@ public class KeyguardViewMediator extends SystemUI { private boolean mWaitingUntilKeyguardVisible = false; private LockPatternUtils mLockPatternUtils; private boolean mKeyguardDonePending = false; + private boolean mHideAnimationRun = false; private SoundPool mLockSounds; private int mLockSoundId; @@ -287,6 +289,7 @@ public class KeyguardViewMediator extends SystemUI { // ActivityManagerService) will not reconstruct the keyguard if it is already showing. synchronized (KeyguardViewMediator.this) { mSwitchingUser = true; + mKeyguardDonePending = false; resetStateLocked(); adjustStatusBarLocked(); // When we switch users we want to bring the new user to the biometric unlock even @@ -431,12 +434,23 @@ public class KeyguardViewMediator extends SystemUI { @Override public void keyguardDonePending() { mKeyguardDonePending = true; + mHideAnimationRun = true; + mStatusBarKeyguardViewManager.startPreHideAnimation(null /* finishRunnable */); } @Override public void keyguardGone() { mKeyguardDisplayManager.hide(); } + + @Override + public void readyForKeyguardDone() { + if (mKeyguardDonePending) { + // Somebody has called keyguardDonePending before, which means that we are + // authenticated + KeyguardViewMediator.this.keyguardDone(true /* authenticated */, true /* wakeUp */); + } + } }; public void userActivity() { @@ -545,6 +559,7 @@ public class KeyguardViewMediator extends SystemUI { if (DEBUG) Log.d(TAG, "onScreenTurnedOff(" + why + ")"); mKeyguardDonePending = false; + mHideAnimationRun = false; // Lock immediately based on setting if secure (user has a pin/pattern/password). // This also "locks" the device when not secure to provide easy access to the @@ -1067,6 +1082,9 @@ public class KeyguardViewMediator extends SystemUI { StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj; handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration); break; + case ON_ACTIVITY_DRAWN: + handleOnActivityDrawn(); + break; } } }; @@ -1181,6 +1199,7 @@ public class KeyguardViewMediator extends SystemUI { mHiding = false; mShowing = true; mKeyguardDonePending = false; + mHideAnimationRun = false; updateActivityLockScreenState(); adjustStatusBarLocked(); userActivity(); @@ -1193,6 +1212,20 @@ public class KeyguardViewMediator extends SystemUI { mKeyguardDisplayManager.show(); } + private final Runnable mKeyguardGoingAwayRunnable = new Runnable() { + @Override + public void run() { + try { + // Don't actually hide the Keyguard at the moment, wait for window + // manager until it tells us it's safe to do so with + // startKeyguardExitAnimation. + mWM.keyguardGoingAway(); + } catch (RemoteException e) { + Log.e(TAG, "Error while calling WindowManager", e); + } + } + }; + /** * Handle message sent by {@link #hideLocked()} * @see #HIDE @@ -1203,19 +1236,11 @@ public class KeyguardViewMediator extends SystemUI { mHiding = true; if (mShowing && !mOccluded) { - mStatusBarKeyguardViewManager.startPreHideAnimation(new Runnable() { - @Override - public void run() { - try { - // Don't actually hide the Keyguard at the moment, wait for window - // manager until it tells us it's safe to do so with - // startKeyguardExitAnimation. - mWM.keyguardGoingAway(); - } catch (RemoteException e) { - Log.e(TAG, "Error while calling WindowManager", e); - } - } - }); + if (!mHideAnimationRun) { + mStatusBarKeyguardViewManager.startPreHideAnimation(mKeyguardGoingAwayRunnable); + } else { + mKeyguardGoingAwayRunnable.run(); + } } else { // Don't try to rely on WindowManager - if Keyguard wasn't showing, window @@ -1227,6 +1252,12 @@ public class KeyguardViewMediator extends SystemUI { } } + private void handleOnActivityDrawn() { + if (mKeyguardDonePending) { + mStatusBarKeyguardViewManager.onActivityDrawn(); + } + } + private void handleStartKeyguardExitAnimation(long startTime, long fadeoutDuration) { synchronized (KeyguardViewMediator.this) { @@ -1244,6 +1275,7 @@ public class KeyguardViewMediator extends SystemUI { mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); mShowing = false; mKeyguardDonePending = false; + mHideAnimationRun = false; updateActivityLockScreenState(); adjustStatusBarLocked(); } @@ -1357,6 +1389,9 @@ public class KeyguardViewMediator extends SystemUI { mHandler.sendMessage(msg); } + public void onActivityDrawn() { + mHandler.sendEmptyMessage(ON_ACTIVITY_DRAWN); + } public ViewMediatorCallback getViewMediatorCallback() { return mViewMediatorCallback; } |