Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/ActivityStarter.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -87,7 +87,9 @@ public interface ActivityStarter { interface OnDismissAction { interface OnDismissAction { /** /** * @return {@code true} if the dismiss should be deferred * @return {@code true} if the dismiss should be deferred. When returning true, make sure to * call {@link com.android.keyguard.ViewMediatorCallback#readyForKeyguardDone()} * *after* returning to start hiding the keyguard. */ */ boolean onDismiss(); boolean onDismiss(); } } Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +10 −5 Original line number Original line Diff line number Diff line Loading @@ -1655,7 +1655,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, * Hide the keyguard and let {@code runner} handle the animation. * Hide the keyguard and let {@code runner} handle the animation. * * * This method should typically be called after {@link ViewMediatorCallback#keyguardDonePending} * This method should typically be called after {@link ViewMediatorCallback#keyguardDonePending} * was called, when we are ready to hide the keyguard. * was called, when we are ready to hide the keyguard. It will do nothing if we were not * expecting the keyguard to go away when called. */ */ public void hideWithAnimation(IRemoteAnimationRunner runner) { public void hideWithAnimation(IRemoteAnimationRunner runner) { if (!mKeyguardDonePending) { if (!mKeyguardDonePending) { Loading Loading @@ -2022,6 +2023,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, } } mHiding = false; mHiding = false; mKeyguardExitAnimationRunner = null; mWakeAndUnlocking = false; mWakeAndUnlocking = false; mPendingLock = false; mPendingLock = false; setShowingLocked(true); setShowingLocked(true); Loading Loading @@ -2157,6 +2159,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, return; return; } } mHiding = false; mHiding = false; IRemoteAnimationRunner runner = mKeyguardExitAnimationRunner; mKeyguardExitAnimationRunner = null; if (mWakeAndUnlocking && mDrawnCallback != null) { if (mWakeAndUnlocking && mDrawnCallback != null) { Loading @@ -2177,9 +2181,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, LatencyTracker.getInstance(mContext) LatencyTracker.getInstance(mContext) .onActionEnd(LatencyTracker.ACTION_LOCKSCREEN_UNLOCK); .onActionEnd(LatencyTracker.ACTION_LOCKSCREEN_UNLOCK); IRemoteAnimationRunner runner = mKeyguardExitAnimationRunner; mKeyguardExitAnimationRunner = null; if (KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && runner != null if (KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && runner != null && finishedCallback != null) { && finishedCallback != null) { // Wrap finishedCallback to clean up the keyguard state once the animation is done. // Wrap finishedCallback to clean up the keyguard state once the animation is done. Loading @@ -2187,7 +2188,11 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, new IRemoteAnimationFinishedCallback() { new IRemoteAnimationFinishedCallback() { @Override @Override public void onAnimationFinished() throws RemoteException { public void onAnimationFinished() throws RemoteException { try { finishedCallback.onAnimationFinished(); finishedCallback.onAnimationFinished(); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onAnimationFinished", e); } onKeyguardExitFinished(); onKeyguardExitFinished(); mKeyguardViewControllerLazy.get().hide(0 /* startTime */, mKeyguardViewControllerLazy.get().hide(0 /* startTime */, 0 /* fadeoutDuration */); 0 /* fadeoutDuration */); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -288,10 +288,19 @@ public class KeyguardBouncer { public void showWithDismissAction(OnDismissAction r, Runnable cancelAction) { public void showWithDismissAction(OnDismissAction r, Runnable cancelAction) { ensureView(); ensureView(); mKeyguardViewController.setOnDismissAction(r, cancelAction); setDismissAction(r, cancelAction); show(false /* resetSecuritySelection */); show(false /* resetSecuritySelection */); } } /** * Set the actions to run when the keyguard is dismissed or when the dismiss is cancelled. Those * actions will still be run even if this bouncer is not shown, for instance when authenticating * with an alternate authenticator like the UDFPS. */ public void setDismissAction(OnDismissAction r, Runnable cancelAction) { mKeyguardViewController.setOnDismissAction(r, cancelAction); } public void hide(boolean destroyView) { public void hide(boolean destroyView) { if (isShowing()) { if (isShowing()) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +0 −5 Original line number Original line Diff line number Diff line Loading @@ -3586,11 +3586,6 @@ public class NotificationPanelViewController extends PanelViewController { * security view of the bouncer. * security view of the bouncer. */ */ public void onBouncerPreHideAnimation() { public void onBouncerPreHideAnimation() { mKeyguardStatusViewController.setKeyguardStatusViewVisibility( mBarState, true /* keyguardFadingAway */, false /* goingToFullShade */, mBarState); if (mKeyguardQsUserSwitchController != null) { if (mKeyguardQsUserSwitchController != null) { mKeyguardQsUserSwitchController.setKeyguardQsUserSwitchVisibility( mKeyguardQsUserSwitchController.setKeyguardQsUserSwitchVisibility( mBarState, mBarState, Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −12 Original line number Original line Diff line number Diff line Loading @@ -2096,13 +2096,10 @@ public class StatusBar extends SystemUI implements DemoMode, return true; return true; } } // If we are locked, only animate if remote unlock animations are enabled and we can dismiss // If we are locked, only animate if remote unlock animations are enabled. We also don't // the lock screen without challenging the user. We also don't animate non-activity // animate non-activity launches as they can break the animation. // launches as they can break the animation. // TODO(b/184121838): Support non activity launches on the lockscreen. // TODO(b/184121838): Support non activity launches on the lockscreen. return isActivityIntent return isActivityIntent && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation; && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && mKeyguardStateController.canDismissLockScreen(); } } @Override @Override Loading @@ -2112,12 +2109,6 @@ public class StatusBar extends SystemUI implements DemoMode, @Override @Override public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { if (!mKeyguardStateController.canDismissLockScreen()) { Log.wtf(TAG, "Unable to hide keyguard with animation as the keyguard can't be dismissed"); return; } // We post to the main thread for 2 reasons: // We post to the main thread for 2 reasons: // 1. KeyguardViewMediator is not thread-safe. // 1. KeyguardViewMediator is not thread-safe. // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/ActivityStarter.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -87,7 +87,9 @@ public interface ActivityStarter { interface OnDismissAction { interface OnDismissAction { /** /** * @return {@code true} if the dismiss should be deferred * @return {@code true} if the dismiss should be deferred. When returning true, make sure to * call {@link com.android.keyguard.ViewMediatorCallback#readyForKeyguardDone()} * *after* returning to start hiding the keyguard. */ */ boolean onDismiss(); boolean onDismiss(); } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +10 −5 Original line number Original line Diff line number Diff line Loading @@ -1655,7 +1655,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, * Hide the keyguard and let {@code runner} handle the animation. * Hide the keyguard and let {@code runner} handle the animation. * * * This method should typically be called after {@link ViewMediatorCallback#keyguardDonePending} * This method should typically be called after {@link ViewMediatorCallback#keyguardDonePending} * was called, when we are ready to hide the keyguard. * was called, when we are ready to hide the keyguard. It will do nothing if we were not * expecting the keyguard to go away when called. */ */ public void hideWithAnimation(IRemoteAnimationRunner runner) { public void hideWithAnimation(IRemoteAnimationRunner runner) { if (!mKeyguardDonePending) { if (!mKeyguardDonePending) { Loading Loading @@ -2022,6 +2023,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, } } mHiding = false; mHiding = false; mKeyguardExitAnimationRunner = null; mWakeAndUnlocking = false; mWakeAndUnlocking = false; mPendingLock = false; mPendingLock = false; setShowingLocked(true); setShowingLocked(true); Loading Loading @@ -2157,6 +2159,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, return; return; } } mHiding = false; mHiding = false; IRemoteAnimationRunner runner = mKeyguardExitAnimationRunner; mKeyguardExitAnimationRunner = null; if (mWakeAndUnlocking && mDrawnCallback != null) { if (mWakeAndUnlocking && mDrawnCallback != null) { Loading @@ -2177,9 +2181,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, LatencyTracker.getInstance(mContext) LatencyTracker.getInstance(mContext) .onActionEnd(LatencyTracker.ACTION_LOCKSCREEN_UNLOCK); .onActionEnd(LatencyTracker.ACTION_LOCKSCREEN_UNLOCK); IRemoteAnimationRunner runner = mKeyguardExitAnimationRunner; mKeyguardExitAnimationRunner = null; if (KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && runner != null if (KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && runner != null && finishedCallback != null) { && finishedCallback != null) { // Wrap finishedCallback to clean up the keyguard state once the animation is done. // Wrap finishedCallback to clean up the keyguard state once the animation is done. Loading @@ -2187,7 +2188,11 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, new IRemoteAnimationFinishedCallback() { new IRemoteAnimationFinishedCallback() { @Override @Override public void onAnimationFinished() throws RemoteException { public void onAnimationFinished() throws RemoteException { try { finishedCallback.onAnimationFinished(); finishedCallback.onAnimationFinished(); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onAnimationFinished", e); } onKeyguardExitFinished(); onKeyguardExitFinished(); mKeyguardViewControllerLazy.get().hide(0 /* startTime */, mKeyguardViewControllerLazy.get().hide(0 /* startTime */, 0 /* fadeoutDuration */); 0 /* fadeoutDuration */); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -288,10 +288,19 @@ public class KeyguardBouncer { public void showWithDismissAction(OnDismissAction r, Runnable cancelAction) { public void showWithDismissAction(OnDismissAction r, Runnable cancelAction) { ensureView(); ensureView(); mKeyguardViewController.setOnDismissAction(r, cancelAction); setDismissAction(r, cancelAction); show(false /* resetSecuritySelection */); show(false /* resetSecuritySelection */); } } /** * Set the actions to run when the keyguard is dismissed or when the dismiss is cancelled. Those * actions will still be run even if this bouncer is not shown, for instance when authenticating * with an alternate authenticator like the UDFPS. */ public void setDismissAction(OnDismissAction r, Runnable cancelAction) { mKeyguardViewController.setOnDismissAction(r, cancelAction); } public void hide(boolean destroyView) { public void hide(boolean destroyView) { if (isShowing()) { if (isShowing()) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +0 −5 Original line number Original line Diff line number Diff line Loading @@ -3586,11 +3586,6 @@ public class NotificationPanelViewController extends PanelViewController { * security view of the bouncer. * security view of the bouncer. */ */ public void onBouncerPreHideAnimation() { public void onBouncerPreHideAnimation() { mKeyguardStatusViewController.setKeyguardStatusViewVisibility( mBarState, true /* keyguardFadingAway */, false /* goingToFullShade */, mBarState); if (mKeyguardQsUserSwitchController != null) { if (mKeyguardQsUserSwitchController != null) { mKeyguardQsUserSwitchController.setKeyguardQsUserSwitchVisibility( mKeyguardQsUserSwitchController.setKeyguardQsUserSwitchVisibility( mBarState, mBarState, Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −12 Original line number Original line Diff line number Diff line Loading @@ -2096,13 +2096,10 @@ public class StatusBar extends SystemUI implements DemoMode, return true; return true; } } // If we are locked, only animate if remote unlock animations are enabled and we can dismiss // If we are locked, only animate if remote unlock animations are enabled. We also don't // the lock screen without challenging the user. We also don't animate non-activity // animate non-activity launches as they can break the animation. // launches as they can break the animation. // TODO(b/184121838): Support non activity launches on the lockscreen. // TODO(b/184121838): Support non activity launches on the lockscreen. return isActivityIntent return isActivityIntent && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation; && KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation && mKeyguardStateController.canDismissLockScreen(); } } @Override @Override Loading @@ -2112,12 +2109,6 @@ public class StatusBar extends SystemUI implements DemoMode, @Override @Override public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { public void hideKeyguardWithAnimation(IRemoteAnimationRunner runner) { if (!mKeyguardStateController.canDismissLockScreen()) { Log.wtf(TAG, "Unable to hide keyguard with animation as the keyguard can't be dismissed"); return; } // We post to the main thread for 2 reasons: // We post to the main thread for 2 reasons: // 1. KeyguardViewMediator is not thread-safe. // 1. KeyguardViewMediator is not thread-safe. // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before // 2. To ensure that ViewMediatorCallback#keyguardDonePending is called before Loading