diff options
author | Dave Mankoff <mankoff@google.com> | 2021-01-25 14:34:43 -0500 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2021-03-10 16:42:23 -0500 |
commit | 8d0f3a0c3c735d9ad9fb7173ccce847f1dc89e1f (patch) | |
tree | 66d44833f3ce8052b56f0cfd02178b9b66a463f1 /packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java | |
parent | e673774033be0dea61ceb35c373044dbc6eeebed (diff) |
Incorporate Bayes into Falsing.
This uses the HistoryTracker on pin-based input to determine if a
tap outside of an intended region is a false touch, retracting the
pin input if we believe pocket dialing is occuring.
To do this, the cl properly integrates the HistoryTracker into
falsing, at least for single taps.
Most importantly, HistoryTracker#falsingBelief now return 0.5 when
it is unsure if a tap is false or not, and tends towards 0 when it
believes it's valid and 1 when it believes it's false.
HistoryTracker#falsingConfidence remains unchanged.
Test: atest SystemUITests && manual
Bug: 172655679
Change-Id: Ie771b1bf8ac564af7ffb68e190772fff5c562e89
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java index f2479488db0f..7fe427822d6a 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java @@ -25,15 +25,14 @@ import android.view.View.OnTouchListener; import com.android.internal.util.LatencyTracker; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; -import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.classifier.FalsingCollector; +import com.android.systemui.classifier.SingleTapClassifier; public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinBasedInputView> extends KeyguardAbsKeyInputViewController<T> { private final LiftToActivateListener mLiftToActivateListener; - private final FalsingCollector mFalsingCollector; protected PasswordTextView mPasswordEntry; private final OnKeyListener mOnKeyListener = (v, keyCode, event) -> { @@ -50,19 +49,6 @@ public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinB return false; }; - private final Gefingerpoken mGlobalTouchListener = new Gefingerpoken() { - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - mFalsingCollector.avoidGesture(); - return false; - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - return false; - } - }; - protected KeyguardPinBasedInputViewController(T view, KeyguardUpdateMonitor keyguardUpdateMonitor, SecurityMode securityMode, @@ -71,11 +57,12 @@ public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinB KeyguardMessageAreaController.Factory messageAreaControllerFactory, LatencyTracker latencyTracker, LiftToActivateListener liftToActivateListener, - FalsingCollector falsingCollector) { + FalsingCollector falsingCollector, + SingleTapClassifier singleTapClassifier) { super(view, keyguardUpdateMonitor, securityMode, lockPatternUtils, keyguardSecurityCallback, - messageAreaControllerFactory, latencyTracker); + messageAreaControllerFactory, latencyTracker, falsingCollector, + singleTapClassifier); mLiftToActivateListener = liftToActivateListener; - mFalsingCollector = falsingCollector; mPasswordEntry = mView.findViewById(mView.getPasswordTextViewId()); } @@ -83,8 +70,6 @@ public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinB protected void onViewAttached() { super.onViewAttached(); - mView.addMotionEventListener(mGlobalTouchListener); - mPasswordEntry.setOnKeyListener(mOnKeyListener); mPasswordEntry.setUserActivityListener(this::onUserInput); @@ -120,11 +105,6 @@ public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinB } } - @Override - protected void onViewDetached() { - super.onViewDetached(); - mView.removeMotionEventListener(mGlobalTouchListener); - } @Override public void onResume(int reason) { |