diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | 33 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java | 11 |
2 files changed, 28 insertions, 16 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 09779d12f7b3..a51683779098 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -2846,12 +2846,13 @@ public class StatusBar extends SystemUI implements DemoMode, @Nullable ActivityLaunchAnimator.Controller animationController) { if (onlyProvisioned && !mDeviceProvisionedController.isDeviceProvisioned()) return; - final boolean afterKeyguardGone = mActivityIntentHelper.wouldLaunchResolverActivity( - intent, mLockscreenUserManager.getCurrentUserId()); + final boolean willLaunchResolverActivity = + mActivityIntentHelper.wouldLaunchResolverActivity(intent, + mLockscreenUserManager.getCurrentUserId()); ActivityLaunchAnimator.Controller animController = - shouldAnimateLaunch(true /* isActivityIntent */) ? wrapAnimationController( - animationController, dismissShade) : null; + !willLaunchResolverActivity && shouldAnimateLaunch(true /* isActivityIntent */) + ? wrapAnimationController(animationController, dismissShade) : null; // If we animate, we will dismiss the shade only once the animation is done. This is taken // care of by the StatusBarLaunchAnimationController. @@ -2915,7 +2916,7 @@ public class StatusBar extends SystemUI implements DemoMode, } }; executeRunnableDismissingKeyguard(runnable, cancelRunnable, dismissShadeDirectly, - afterKeyguardGone, true /* deferred */); + willLaunchResolverActivity, true /* deferred */); } @Nullable @@ -4620,9 +4621,11 @@ public class StatusBar extends SystemUI implements DemoMode, * * @param action The action to execute after dismissing the keyguard. * @param collapsePanel Whether we should collapse the panel after dismissing the keyguard. + * @param deferKeyguardDismiss Whether we should defer the keyguard actual dismissal, for + * instance to run animations on the keyguard before hiding it. */ private void executeActionDismissingKeyguard(Runnable action, boolean afterKeyguardGone, - boolean collapsePanel) { + boolean collapsePanel, boolean deferKeyguardDismiss) { if (!mDeviceProvisionedController.isDeviceProvisioned()) return; dismissKeyguardThenExecute(() -> { @@ -4638,8 +4641,7 @@ public class StatusBar extends SystemUI implements DemoMode, action.run(); }).start(); - boolean deferred = collapsePanel ? mShadeController.collapsePanel() : false; - return deferred; + return collapsePanel ? mShadeController.collapsePanel() : deferKeyguardDismiss; }, afterKeyguardGone); } @@ -4672,12 +4674,19 @@ public class StatusBar extends SystemUI implements DemoMode, public void startPendingIntentDismissingKeyguard( final PendingIntent intent, @Nullable final Runnable intentSentUiThreadCallback, @Nullable ActivityLaunchAnimator.Controller animationController) { - final boolean afterKeyguardGone = intent.isActivity() + final boolean willLaunchResolverActivity = intent.isActivity() && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(), mLockscreenUserManager.getCurrentUserId()); - boolean collapse = animationController == null; - boolean animate = shouldAnimateLaunch(intent.isActivity()); + boolean animate = !willLaunchResolverActivity + && animationController != null + && shouldAnimateLaunch(intent.isActivity()); + + // If we animate, don't collapse the shade and defer the keyguard dismiss (in case we run + // the animation on the keyguard). The animation will take care of (instantly) collapsing + // the shade and hiding the keyguard once it is done. + boolean collapse = !animate; + boolean deferKeyguardDismiss = animate; executeActionDismissingKeyguard(() -> { try { // We wrap animationCallback with a StatusBarLaunchAnimatorController so that the @@ -4706,7 +4715,7 @@ public class StatusBar extends SystemUI implements DemoMode, if (intentSentUiThreadCallback != null) { postOnUiThread(intentSentUiThreadCallback); } - }, afterKeyguardGone, collapse); + }, willLaunchResolverActivity, collapse, deferKeyguardDismiss); } private void postOnUiThread(Runnable runnable) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java index 7b7c17d08eda..d93b76646d58 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java @@ -252,10 +252,11 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit } boolean isActivityIntent = intent != null && intent.isActivity() && !isBubble; - final boolean afterKeyguardGone = isActivityIntent + final boolean willLaunchResolverActivity = isActivityIntent && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(), mLockscreenUserManager.getCurrentUserId()); - final boolean animate = mStatusBar.shouldAnimateLaunch(isActivityIntent); + final boolean animate = !willLaunchResolverActivity + && mStatusBar.shouldAnimateLaunch(isActivityIntent); boolean showOverLockscreen = mKeyguardStateController.isShowing() && intent != null && mActivityIntentHelper.wouldShowOverLockscreen(intent.getIntent(), mLockscreenUserManager.getCurrentUserId()); @@ -268,7 +269,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit postKeyguardAction.onDismiss(); } else { mActivityStarter.dismissKeyguardThenExecute( - postKeyguardAction, null /* cancel */, afterKeyguardGone); + postKeyguardAction, null /* cancel */, willLaunchResolverActivity); } } @@ -296,7 +297,9 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit } else { runnable.run(); } - return !mNotificationPanel.isFullyCollapsed(); + + // Always defer the keyguard dismiss when animating. + return animate || !mNotificationPanel.isFullyCollapsed(); } private void handleNotificationClickAfterPanelCollapsed( |