From ff72d154d7fb1490db90083c3fe3c41f5ce6bc57 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 10 Sep 2024 12:13:39 -0700 Subject: [PATCH] Do not delay taskbar background animation when closing taskbar all apps. Fixes: 362379633 Flag: EXEMPT bugfix Test: open app, unstash transient taskbar, open Taskbar All Apps, close it Change-Id: I0819ae12bd599be051cb0da4091ab02d0759984c --- .../taskbar/TaskbarStashController.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 56f88d12f5..f4aa3f9958 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -576,6 +576,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba /* isStashed= */ mActivity.isPhoneMode(), placeholderDuration, TRANSITION_UNSTASH_SUW_MANUAL, + /* skipTaskbarBackgroundDelay */ false, /* jankTag= */ "SUW_MANUAL"); animation.addListener(AnimatorListeners.forEndCallback( () -> mControllers.taskbarViewController.setDeferUpdatesForSUW(false))); @@ -585,13 +586,14 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba /** * Create a stash animation and save to {@link #mAnimator}. * - * @param isStashed whether it's a stash animation or an unstash animation - * @param duration duration of the animation - * @param animationType what transition type to play. - * @param jankTag tag to be used in jank monitor trace. + * @param isStashed whether it's a stash animation or an unstash animation + * @param duration duration of the animation + * @param animationType what transition type to play. + * @param skipTaskbarBackgroundDelay Iff true, skips delaying the taskbar background. + * @param jankTag tag to be used in jank monitor trace. */ private void createAnimToIsStashed(boolean isStashed, long duration, - @StashAnimation int animationType, String jankTag) { + @StashAnimation int animationType, boolean skipTaskbarBackgroundDelay, String jankTag) { if (animationType == TRANSITION_UNSTASH_SUW_MANUAL && isStashed) { // The STASH_ANIMATION_SUW_MANUAL must only be used during an unstash animation. Log.e(TAG, "Illegal arguments:Using TRANSITION_UNSTASH_SUW_MANUAL to stash taskbar"); @@ -629,7 +631,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } if (isTransientTaskbar) { - createTransientAnimToIsStashed(mAnimator, isStashed, duration, animationType); + createTransientAnimToIsStashed(mAnimator, isStashed, duration, + skipTaskbarBackgroundDelay, animationType); } else { createAnimToIsStashed(mAnimator, isStashed, duration, stashTranslation, animationType); } @@ -735,7 +738,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } private void createTransientAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration, - @StashAnimation int animationType) { + boolean skipTaskbarBackgroundDelay, @StashAnimation int animationType) { // Target values of the properties this is going to set final float backgroundOffsetTarget = isStashed ? 1 : 0; final float iconAlphaTarget = isStashed ? 0 : 1; @@ -786,7 +789,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba backgroundAndHandleAlphaStartDelay, backgroundAndHandleAlphaDuration, LINEAR); - if (enableScalingRevealHomeAnimation() && !isStashed) { + if (enableScalingRevealHomeAnimation() && isStashed && !skipTaskbarBackgroundDelay) { play(as, getTaskbarBackgroundAnimatorWhenNotGoingHome(duration), 0, 0, LINEAR); as.addListener(AnimatorListeners.forEndCallback( @@ -1339,8 +1342,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba mIsStashed = isStashed; mLastStartedTransitionType = animationType; + boolean skipTaskbarBgDelay = !hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS) + && hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS, changedFlags); // This sets mAnimator. - createAnimToIsStashed(mIsStashed, duration, animationType, + createAnimToIsStashed(mIsStashed, duration, animationType, skipTaskbarBgDelay, computeTaskbarJankMonitorTag(changedFlags)); return mAnimator; }