From 3a057251ac660cbbb5d71145a97ee179247e3d4a Mon Sep 17 00:00:00 2001 From: arthurhung Date: Fri, 8 May 2020 13:41:25 +0800 Subject: [PATCH] Make sure AmbiguousGestureMultiplier could start from 1 If a motion event classified CLASSIFICATION_AMBIGUOUS_GESTURE, it would multiplied the AmbiguousGestureMultiplier from configuration for the touch slop, we have to make sure this value should be start from 1 or the touch slop could be zero and click action may fail. Bug: 155160957 Test: manual Change-Id: I61e1262b4f3de61214297b678956cc14fa2f24ef --- core/java/android/view/ViewConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 69d37ab91a1c9..0d2d4d13eb387 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -416,7 +416,7 @@ public class ViewConfiguration { com.android.internal.R.dimen.config_ambiguousGestureMultiplier, multiplierValue, true /*resolveRefs*/); - mAmbiguousGestureMultiplier = multiplierValue.getFloat(); + mAmbiguousGestureMultiplier = Math.max(1.0f, multiplierValue.getFloat()); // Size of the screen in bytes, in ARGB_8888 format final WindowManager windowManager = context.getSystemService(WindowManager.class);