diff options
| author | 2017-09-05 18:16:17 +0000 | |
|---|---|---|
| committer | 2017-09-05 18:16:17 +0000 | |
| commit | dc70defa05a3a5e7b91e8e8b8a2ce22db48455ef (patch) | |
| tree | 1393d505ef02c129940e220295648b496b82eb54 | |
| parent | e6a5f1c9d6160423424d2bc9e25558de0a6da302 (diff) | |
| parent | b0d617a64391a61af06c999df0f77e43ef615880 (diff) | |
Merge "FalsingManager: Allow disabling the HIC via device config flag" into oc-mr1-dev
am: b0d617a643
Change-Id: I14027f7967a0c4de691110b6a96ae46ea6424ca5
| -rw-r--r-- | packages/SystemUI/res/values/config.xml | 5 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 89e2675ad0fc..87f6306ffb9a 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -417,4 +417,9 @@ vibrator is capable of subtle vibrations --> <bool name="config_vibrateOnIconAnimation">false</bool> + <!-- If true, enable the advance anti-falsing classifier on the lockscreen. On some devices it + does not work well, particularly with noisy touchscreens. Note that disabling it may + increase the rate of unintentional unlocks. --> + <bool name="config_lockscreenAntiFalsingClassifierEnabled">true</bool> + </resources> diff --git a/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java index 2e9ba567c74d..592a275edaa0 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/HumanInteractionClassifier.java @@ -27,6 +27,8 @@ import android.util.DisplayMetrics; import android.util.Log; import android.view.MotionEvent; +import com.android.systemui.R; + import java.util.ArrayDeque; import java.util.ArrayList; @@ -37,9 +39,6 @@ public class HumanInteractionClassifier extends Classifier { private static final String HIC_ENABLE = "HIC_enable"; private static final float FINGER_DISTANCE = 0.1f; - /** Default value for the HIC_ENABLE setting: 1 - enabled, 0 - disabled */ - private static final int HIC_ENABLE_DEFAULT = 1; - private static HumanInteractionClassifier sInstance = null; private final Handler mHandler = new Handler(Looper.getMainLooper()); @@ -106,9 +105,12 @@ public class HumanInteractionClassifier extends Classifier { } private void updateConfiguration() { + boolean defaultValue = mContext.getResources().getBoolean( + R.bool.config_lockscreenAntiFalsingClassifierEnabled); + mEnableClassifier = 0 != Settings.Global.getInt( mContext.getContentResolver(), - HIC_ENABLE, HIC_ENABLE_DEFAULT); + HIC_ENABLE, defaultValue ? 1 : 0); } public void setType(int type) { |