From 8d0f3a0c3c735d9ad9fb7173ccce847f1dc89e1f Mon Sep 17 00:00:00 2001 From: Dave Mankoff Date: Mon, 25 Jan 2021 14:34:43 -0500 Subject: 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 --- .../KeyguardPinBasedInputViewController.java | 30 ++++------------------ 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java') 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 extends KeyguardAbsKeyInputViewController { 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 Date: Thu, 4 Mar 2021 10:52:04 -0500 Subject: Add continuous falsing to keyguard. With this change, taps outside of the bouncer inputs increase the FalsingManager's belief that erroneous taps are happening. If the belief becomes strong enough, the bouncer will be retracted. Special attention is given to ensure that actual password inputs are not recorded by the falsing manager. Valid button and pattern inputs do not have their motion events recorded, but do _decrease_ the FalsingManager's belief in pocket dialing. Thus, a few bad taps mixed with good taps will not retract the bouncer. Test: atest SystemUITests && manual Bug: 172655679 Change-Id: Iac8d2a2f41764f3c1cccb66b9d332c489cabca77 --- .../KeyguardPinBasedInputViewController.java | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java') diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java index 7fe427822d6a..b156f8169b50 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java @@ -27,12 +27,12 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.systemui.R; import com.android.systemui.classifier.FalsingCollector; -import com.android.systemui.classifier.SingleTapClassifier; public abstract class KeyguardPinBasedInputViewController extends KeyguardAbsKeyInputViewController { private final LiftToActivateListener mLiftToActivateListener; + private final FalsingCollector mFalsingCollector; protected PasswordTextView mPasswordEntry; private final OnKeyListener mOnKeyListener = (v, keyCode, event) -> { @@ -57,12 +57,11 @@ public abstract class KeyguardPinBasedInputViewController { + if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { + mFalsingCollector.avoidGesture(); + } + return false; + }); + } mPasswordEntry.setOnKeyListener(mOnKeyListener); mPasswordEntry.setUserActivityListener(this::onUserInput); @@ -105,6 +112,14 @@ public abstract class KeyguardPinBasedInputViewController Date: Fri, 19 Feb 2021 16:38:09 +0000 Subject: Revert^2 "Add Controller for Emergency Button." f23acf33ff3684586b7dc66026b518ada77eed84 Change-Id: Id555c35af9a5ed2570504cd6b4e3ca3b5892c340 --- .../src/com/android/keyguard/KeyguardPinBasedInputViewController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java') diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java index b156f8169b50..8de4e7b557f3 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputViewController.java @@ -57,9 +57,11 @@ public abstract class KeyguardPinBasedInputViewController