Fix thresholds with deferred-start swipe up gestures

- We were previously using the drag threshold (10dp) for both gesture start
  and drag start, when we should be using the touch threshold (24dp) for
  the deferred gesture start to ensure it coincides with the touch threshold
  for the buttons in the nav bar.

Bug: 79970627
Test: Swipe up over the back button, ensure that we don't both start the
      animation and also trigger back press

Change-Id: Ib4b2a3e2492da144485f87be5477eabf3e96e843
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index 2d41a5b..d1003a5 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -82,7 +82,10 @@
     private final PointF mLastPos = new PointF();
     private int mActivePointerId = INVALID_POINTER_ID;
     private boolean mPassedInitialSlop;
+    // Used for non-deferred gestures to determine when to start dragging
     private int mQuickStepDragSlop;
+    // Used for deferred gestures to determine both start of animation and dragging
+    private int mQuickStepTouchSlop;
     private float mStartDisplacement;
     private WindowTransformSwipeHandler mInteractionHandler;
     private int mDisplayRotation;
@@ -128,6 +131,7 @@
                 mLastPos.set(mDownPos);
                 mPassedInitialSlop = false;
                 mQuickStepDragSlop = NavigationBarCompat.getQuickStepDragSlopPx();
+                mQuickStepTouchSlop = NavigationBarCompat.getQuickStepTouchSlopPx();
 
                 // Start the window animation on down to give more time for launcher to draw if the
                 // user didn't start the gesture over the back button
@@ -160,15 +164,22 @@
                 }
                 mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
                 float displacement = getDisplacement(ev);
-                if (!mPassedInitialSlop
-                        && Math.abs(displacement) > mQuickStepDragSlop) {
-                    mPassedInitialSlop = true;
-                    mStartDisplacement = displacement;
-
-                    // If we deferred starting the window animation on touch down, then
-                    // start tracking now
+                if (!mPassedInitialSlop) {
                     if (mIsDeferredDownTarget) {
-                        startTouchTrackingForWindowAnimation(ev.getEventTime());
+                        // Deferred gesture, start the animation and gesture tracking once we pass
+                        // the touch slop
+                        if (Math.abs(displacement) > mQuickStepTouchSlop) {
+                            startTouchTrackingForWindowAnimation(ev.getEventTime());
+                            mPassedInitialSlop = true;
+                            mStartDisplacement = displacement;
+                        }
+                    } else {
+                        // Normal gesture, ensure we pass the drag slop before we start tracking
+                        // the gesture
+                        if (Math.abs(displacement) > mQuickStepDragSlop) {
+                            mPassedInitialSlop = true;
+                            mStartDisplacement = displacement;
+                        }
                     }
                 }