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
Merged-In: I33ce5c1d4955b34d4b77d3b740dc599621bd4ed1
This commit is contained in:
Schneider Victor-tulias
2023-06-23 15:43:39 -07:00
parent 0da5208bb3
commit 1b2c2e694c
2 changed files with 7 additions and 6 deletions
@@ -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);
@@ -254,6 +254,9 @@ public class AllSetActivity extends Activity {
mBinder.setSwipeUpProxy(isResumed() ? this::createSwipeUpProxy : null);
mBinder.setOverviewTargetChangeListener(mBinder::preloadOverviewForSUWAllSet);
mBinder.preloadOverviewForSUWAllSet();
if (mTaskbarManager != null) {
mLauncherStartAnim = mTaskbarManager.createLauncherStartFromSuwAnim(MAX_SWIPE_DURATION);
}
}
@Override
@@ -328,12 +331,9 @@ public class AllSetActivity extends Activity {
mRootView.setAlpha(alpha);
mRootView.setTranslationY((alpha - 1) * mSwipeUpShift);
if (mLauncherStartAnim == null && mTaskbarManager != null) {
mLauncherStartAnim = mTaskbarManager.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();
}