From 4edce0100aed3ca4a3a18c0bdfee38a196e2fee9 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 31 Jan 2023 21:44:22 +0000 Subject: [PATCH] Dispatch onAnimationStart and End to maintain proper state The AnimatorPlaybackController from createLauncherStateFromSuwAnimation does not ever get started (it's all user-driven) and thus some internal state is not updated properly, namely mIsStashed is never set to false even though the animation unstashes visually. This will break the first "real" unstash animation after SUW. Thus, when the animation from SUW is completed, we now dispatch onAnimationStart() and End() to ensure the proper state is updated. Test: adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity Then, skip to the end and swipe to home; ensure first app launch properly stashes taskbar Fixes: 263533070 Change-Id: I9553b8a884fb84303e2e97f14b9a7051e9de4709 --- .../quickstep/interaction/AllSetActivity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index e0262d02eb..0389d077f7 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -240,6 +240,7 @@ public class AllSetActivity extends Activity { maybeResumeOrPauseBackgroundAnimation(); if (mSwipeProgress.value >= 1) { finishAndRemoveTask(); + dispatchLauncherAnimStartEnd(); } } @@ -251,6 +252,18 @@ public class AllSetActivity extends Activity { } } + /** + * Should be called when we have successfully reached Launcher, so we dispatch to animation + * listeners to ensure the state matches the visual animation that just occurred. + */ + private void dispatchLauncherAnimStartEnd() { + if (mLauncherStartAnim != null) { + mLauncherStartAnim.dispatchOnStart(); + mLauncherStartAnim.dispatchOnEnd(); + mLauncherStartAnim = null; + } + } + @Override protected void onDestroy() { super.onDestroy(); @@ -259,6 +272,7 @@ public class AllSetActivity extends Activity { if (mBackgroundAnimatorListener != null) { mAnimatedBackground.removeAnimatorListener(mBackgroundAnimatorListener); } + dispatchLauncherAnimStartEnd(); } private AnimatedFloat createSwipeUpProxy(GestureState state) {