OSDN Git Service

Allow for more wiggle room (literally) in BrightlineFalsingManager.
authorDave Mankoff <mankoff@google.com>
Tue, 13 Aug 2019 21:52:01 +0000 (17:52 -0400)
committerDave Mankoff <mankoff@google.com>
Wed, 14 Aug 2019 17:10:48 +0000 (13:10 -0400)
Bug: 138812628
Change-Id: I8590b2daff0337a395d333c07c2231cc10d236a3
Test: manual testing with different people to find better values.

packages/SystemUI/src/com/android/systemui/classifier/brightline/ZigZagClassifier.java
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/ZigZagClassifierTest.java

index c58b7db..82ae30a 100644 (file)
@@ -39,8 +39,8 @@ class ZigZagClassifier extends FalsingClassifier {
     // most swipes will follow somewhat of a 'C' or 'S' shape, we allow more deviance along the
     // `SECONDARY` axis.
     private static final float MAX_X_PRIMARY_DEVIANCE = .05f;
-    private static final float MAX_Y_PRIMARY_DEVIANCE = .05f;
-    private static final float MAX_X_SECONDARY_DEVIANCE = .3f;
+    private static final float MAX_Y_PRIMARY_DEVIANCE = .1f;
+    private static final float MAX_X_SECONDARY_DEVIANCE = .6f;
     private static final float MAX_Y_SECONDARY_DEVIANCE = .3f;
 
     private final float mMaxXPrimaryDeviance;
index 25a1a75..fb4c1ec 100644 (file)
@@ -133,8 +133,8 @@ public class ZigZagClassifierTest extends ClassifierTest {
         // This test looks just like testPass_horizontalZigZagVerticalStraight but with
         // a shorter y range, making it look more crooked.
         appendMoveEvent(0, 0);
-        appendMoveEvent(5, 10);
-        appendMoveEvent(-5, 20);
+        appendMoveEvent(6, 10);
+        appendMoveEvent(-6, 20);
         assertThat(mClassifier.isFalseTouch(), is(true));
     }