diff options
| author | 2021-06-14 15:02:45 -0400 | |
|---|---|---|
| committer | 2021-08-18 08:22:34 -0400 | |
| commit | da9d2fcc5896c17e3892f41d062c2424ba7d56cf (patch) | |
| tree | 5b063ba9aa17d5f814026c708bf9178157a9efe7 | |
| parent | 9e5c45cb478ba9b71b2a6f111ea7bd47eecfc6ef (diff) | |
Move ActivityLaunchAnimator.KeyguardHandler internal to StatusBar.
Bug: 190746471
Test: atest SystemUITest
Change-Id: Ie43400d2833835af945a90e2c2663b123bbc185b
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 28510abb51b4..f6db050ecb5b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -252,8 +252,7 @@ import dagger.Lazy; /** */ public class StatusBar extends SystemUI implements ActivityStarter, - LifecycleOwner, - ActivityLaunchAnimator.Callback { + LifecycleOwner { public static final boolean MULTIUSER_DEBUG = false; protected static final int MSG_HIDE_RECENT_APPS = 1020; @@ -919,6 +918,40 @@ public class StatusBar extends SystemUI implements } } }; + + private final ActivityLaunchAnimator.Callback mKeyguardHandler = + new ActivityLaunchAnimator.Callback() { + @Override + public boolean isOnKeyguard() { + return mKeyguardStateController.isShowing(); + } + + @Override + public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { + // We post to the main thread for 2 reasons: + // 1. KeyguardViewMediator is not thread-safe. + // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before + // ViewMediatorCallback#readyForKeyguardDone. The wrong order could occur when + // doing dismissKeyguardThenExecute { hideKeyguardWithAnimation(runner) }. + mMainThreadHandler.post(() -> mKeyguardViewMediator.hideWithAnimation(runner)); + } + + @Override + public void setBlursDisabledForAppLaunch(boolean disabled) { + mKeyguardViewMediator.setBlursDisabledForAppLaunch(disabled); + } + + @Override + public int getBackgroundColor(TaskInfo task) { + if (!mStartingSurfaceOptional.isPresent()) { + Log.w(TAG, "No starting surface, defaulting to SystemBGColor"); + return SplashscreenContentDrawer.getSystemBGColor(); + } + + return mStartingSurfaceOptional.get().getBackgroundColor(task); + } + }; + /** * Public constructor for StatusBar. * @@ -1634,7 +1667,7 @@ public class StatusBar extends SystemUI implements private void setUpPresenter() { // Set up the initial notification state. - mActivityLaunchAnimator = new ActivityLaunchAnimator(this, mContext); + mActivityLaunchAnimator = new ActivityLaunchAnimator(mKeyguardHandler, mContext); mNotificationAnimationProvider = new NotificationLaunchAnimatorControllerProvider( mNotificationShadeWindowViewController, mStackScrollerController.getNotificationListContainer(), @@ -2133,36 +2166,6 @@ public class StatusBar extends SystemUI implements return isActivityIntent && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation; } - @Override - public boolean isOnKeyguard() { - return mKeyguardStateController.isShowing(); - } - - @Override - public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { - // We post to the main thread for 2 reasons: - // 1. KeyguardViewMediator is not thread-safe. - // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before - // ViewMediatorCallback#readyForKeyguardDone. The wrong order could occur when doing - // dismissKeyguardThenExecute { hideKeyguardWithAnimation(runner) }. - mMainThreadHandler.post(() -> mKeyguardViewMediator.hideWithAnimation(runner)); - } - - @Override - public void setBlursDisabledForAppLaunch(boolean disabled) { - mKeyguardViewMediator.setBlursDisabledForAppLaunch(disabled); - } - - @Override - public int getBackgroundColor(TaskInfo task) { - if (!mStartingSurfaceOptional.isPresent()) { - Log.w(TAG, "No starting surface, defaulting to SystemBGColor"); - return SplashscreenContentDrawer.getSystemBGColor(); - } - - return mStartingSurfaceOptional.get().getBackgroundColor(task); - } - public boolean isDeviceInVrMode() { return mPresenter.isDeviceInVrMode(); } |