Finish recents animation synchronously on cancel event

Fixes: 300247322
Test: invoke omnient via long press nav handle
Flag: ENABLE_LONG_PRESS_NAV_HANDLE

Change-Id: I5d7cd1d0a2a50da26a881a6daa203806bf857909
This commit is contained in:
Tony Wickham committed 2023-09-18 15:34:29 +00:00
1 parent 3c898a7550
commit 2316dc4750
3 files changed
+10 -5

No files matched your search

@@ -417,8 +417,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
private void finishTouchTracking(MotionEvent ev) {
TraceHelper.INSTANCE.beginSection(UP_EVT);
boolean isCanceled = ev.getActionMasked() == ACTION_CANCEL;
if (mPassedWindowMoveSlop && mInteractionHandler != null) {
if (ev.getActionMasked() == ACTION_CANCEL) {
if (isCanceled) {
mInteractionHandler.onGestureCancelled();
} else {
mVelocityTracker.computeCurrentVelocity(PX_PER_MS);
@@ -440,8 +441,10 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
if (mActiveCallbacks != null && mInteractionHandler != null) {
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
// The animation started, but with no movement, in this case, there will be no
// animateToProgress so we have to manually finish here.
mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */);
// animateToProgress so we have to manually finish here. In the case of
// ACTION_CANCEL, someone else may be doing something so finish synchronously.
mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */,
isCanceled /* forceFinish */);
} else {
// The animation hasn't started yet, so insert a replacement handler into the
// callbacks which immediately finishes the animation after it starts.