Disable anti-falsing logic with touch exploration
Change-Id: Ide1992f11ace9c2604f68fe3c9277c3e20ecb71a
Fixes: 28140321
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
index 0798590..1ac5992 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
@@ -27,6 +27,7 @@
import android.os.UserHandle;
import android.provider.Settings;
import android.view.MotionEvent;
+import android.view.accessibility.AccessibilityManager;
import com.android.systemui.analytics.DataCollector;
import com.android.systemui.statusbar.StatusBarState;
@@ -60,6 +61,7 @@
private final SensorManager mSensorManager;
private final DataCollector mDataCollector;
private final HumanInteractionClassifier mHumanInteractionClassifier;
+ private final AccessibilityManager mAccessibilityManager;
private static FalsingManager sInstance = null;
@@ -78,7 +80,8 @@
private FalsingManager(Context context) {
mContext = context;
- mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
+ mSensorManager = mContext.getSystemService(SensorManager.class);
+ mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
mDataCollector = DataCollector.getInstance(mContext);
mHumanInteractionClassifier = HumanInteractionClassifier.getInstance(mContext);
mScreenOn = context.getSystemService(PowerManager.class).isInteractive();
@@ -177,6 +180,11 @@
.toString());
}
}
+ if (mAccessibilityManager.isTouchExplorationEnabled()) {
+ // Touch exploration triggers false positives in the classifier and
+ // already sufficiently prevents false unlocks.
+ return false;
+ }
return mHumanInteractionClassifier.isFalseTouch();
}