Merging ub-launcher3-qt-r1-dev, build 5800211
Test: Manual
Bug:138881088 P1 Sometimes home gesture mis-interpreted as overview
Change-Id: Ic0b841c32910f77592b4a6eb372751a85350bae5
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 7a67a2a..0d29e5d 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -736,18 +736,19 @@
: LAST_TASK;
}
} else {
- if (mMode == Mode.NO_BUTTON && endVelocity < 0 && !mIsShelfPeeking) {
+ // If swiping at a diagonal, base end target on the faster velocity.
+ boolean isSwipeUp = endVelocity < 0;
+ boolean willGoToNewTaskOnSwipeUp =
+ goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity);
+
+ if (mMode == Mode.NO_BUTTON && isSwipeUp && !willGoToNewTaskOnSwipeUp) {
+ endTarget = HOME;
+ } else if (mMode == Mode.NO_BUTTON && isSwipeUp && !mIsShelfPeeking) {
// If swiping at a diagonal, base end target on the faster velocity.
- endTarget = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity)
- ? NEW_TASK : HOME;
- } else if (endVelocity < 0) {
- if (reachedOverviewThreshold) {
- endTarget = RECENTS;
- } else {
- // If swiping at a diagonal, base end target on the faster velocity.
- endTarget = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity)
- ? NEW_TASK : RECENTS;
- }
+ endTarget = NEW_TASK;
+ } else if (isSwipeUp) {
+ endTarget = !reachedOverviewThreshold && willGoToNewTaskOnSwipeUp
+ ? NEW_TASK : RECENTS;
} else {
endTarget = goingToNewTask ? NEW_TASK : LAST_TASK;
}