From ad2279a26e129bc68df5cda3faae208884934993 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Fri, 23 Jun 2023 15:43:39 -0700 Subject: [PATCH] Handle onFlingFinished onRecentsAnimationStart If the onRecentsAnimationStart callback runs after the user lifts their finger and onFlingFinished runs, then onFlingFinished never has another chance to run, leaving the user trapped in a state where the launcher is not started and the AllSetActivity is still present but invisible. Reverted to allow onFlingFinished to run onRecentsAnimationStart to handle this edge case. Flag: not needed Fixes: 285194839 Test: Ran AllSetActivty with a delay in onRecentsAnimationStart Change-Id: I33ce5c1d4955b34d4b77d3b740dc599621bd4ed1 --- .../ProgressDelegateInputConsumer.java | 3 ++- .../quickstep/interaction/AllSetActivity.java | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java index 5202529942..c9c64b669c 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java @@ -103,7 +103,8 @@ public class ProgressDelegateInputConsumer implements InputConsumer, mStateCallback = new MultiStateCallback(STATE_NAMES); mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_HANDLER_INVALIDATED, this::endRemoteAnimation); - mStateCallback.runOnceAtState(STATE_FLING_FINISHED, this::onFlingFinished); + mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_FLING_FINISHED, + this::onFlingFinished); mSwipeDetector = new SingleAxisSwipeDetector(mContext, this, VERTICAL); mSwipeDetector.setDetectableScrollConditions(DIRECTION_POSITIVE, false); diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index 42b0edfc5c..9f6119c5a5 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -252,6 +252,10 @@ public class AllSetActivity extends Activity { binder.setSwipeUpProxy(isResumed() ? this::createSwipeUpProxy : null); binder.setOverviewTargetChangeListener(binder::preloadOverviewForSUWAllSet); binder.preloadOverviewForSUWAllSet(); + TaskbarManager taskbarManager = binder.getTaskbarManager(); + if (taskbarManager != null) { + mLauncherStartAnim = taskbarManager.createLauncherStartFromSuwAnim(MAX_SWIPE_DURATION); + } } @Override @@ -327,13 +331,9 @@ public class AllSetActivity extends Activity { mRootView.setAlpha(alpha); mRootView.setTranslationY((alpha - 1) * mSwipeUpShift); - TaskbarManager taskbarManager = mTISBindHelper.getTaskbarManager(); - if (mLauncherStartAnim == null && taskbarManager != null) { - mLauncherStartAnim = taskbarManager.createLauncherStartFromSuwAnim(MAX_SWIPE_DURATION); - } if (mLauncherStartAnim != null) { - mLauncherStartAnim.setPlayFraction(Utilities.mapBoundToRange( - mSwipeProgress.value, 0, 1, 0, 1, FAST_OUT_SLOW_IN)); + mLauncherStartAnim.setPlayFraction( + FAST_OUT_SLOW_IN.getInterpolation(mSwipeProgress.value)); } maybeResumeOrPauseBackgroundAnimation(); }