From 1f913ea0dca7b13c32d6776c262d225aa5c8eada Mon Sep 17 00:00:00 2001 From: ryanlwlin Date: Sat, 20 Jun 2020 13:52:44 +0800 Subject: [PATCH] Fix Hard to detect multi-finger multi-tap The double-tap/touch slope is from system's double-tap detector. This threshold is too narrow for multi-finger multi-tap. It ends up canceling the detection when the movement exceed the slope. We adjust the slopes by multiplying the target finger count. The maxium slope in 4 fingers is around 4.48 mm is smaller than the swipe threshold (1 cm) Bug: 158725482 Test: atest GestureManifoldTest atest TouchExplorerTest atest AccessibilityGestureDetectorTest Change-Id: If0927d15d61a9682da67721d0bf0bbbc1045078b --- .../server/accessibility/gestures/MultiFingerMultiTap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/accessibility/java/com/android/server/accessibility/gestures/MultiFingerMultiTap.java b/services/accessibility/java/com/android/server/accessibility/gestures/MultiFingerMultiTap.java index 642a841257bf7..09e060570c93d 100644 --- a/services/accessibility/java/com/android/server/accessibility/gestures/MultiFingerMultiTap.java +++ b/services/accessibility/java/com/android/server/accessibility/gestures/MultiFingerMultiTap.java @@ -67,8 +67,8 @@ class MultiFingerMultiTap extends GestureMatcher { Preconditions.checkArgumentPositive(taps, "Tap count must greater than 0."); mTargetTapCount = taps; mTargetFingerCount = fingers; - mDoubleTapSlop = ViewConfiguration.get(context).getScaledDoubleTapSlop(); - mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); + mDoubleTapSlop = ViewConfiguration.get(context).getScaledDoubleTapSlop() * fingers; + mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop() * fingers; mBases = new PointF[mTargetFingerCount]; for (int i = 0; i < mBases.length; i++) {