From bde366ddd1d21aabd68c8bc5de0c0769750625d2 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Tue, 10 May 2022 17:34:59 -0700 Subject: [PATCH] Ignore swipe velocity if next task is considered the destination. Test: Manual Bug: 222117127 Change-Id: I5dc0d0a84aae275eebb59a64b59e5344b4b591c4 --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index f60b2253e4..dc2b61b4dc 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1065,10 +1065,11 @@ public abstract class AbsSwipeUpHandler, : LAST_TASK; } } else { - // If swiping at a diagonal, base end target on the faster velocity. + // If swiping at a diagonal on the current task, base end target on the faster velocity. boolean isSwipeUp = endVelocity < 0; - boolean willGoToNewTask = - canGoToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity); + boolean willGoToNewTask = canGoToNewTask && ( + mRecentsView.getDestinationPage() != mRecentsView.getCurrentPage() + || Math.abs(velocity.x) > Math.abs(endVelocity)); if (mDeviceState.isFullyGesturalNavMode() && isSwipeUp) { endTarget = willGoToNewTask ? NEW_TASK : HOME;