summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
Commit message (Collapse)AuthorAgeFilesLines
* Separate out FalsingManager#isFalseTapDave Mankoff2021-04-071-2/+2
| | | | | | | | | | | | | Method no longer takes `robustCheck` parameter. Instead, FalsingManager#isSimpleTap is added for basic checking, and FalsingManager#isTap does robust checking by default. FalsingManager#isTap takes an enum value for penalty instead of a double, making the value more understandable. Bug: 172655679 Test: atest SystemUITests && manual Change-Id: Ib4a99f87bcd6acee67a98420f460c98d44fa6360
* Add more logging for falsing.Dave Mankoff2021-03-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | Makes the FalsingManager slightly less stateful (passing the interaction type directly to the classifiers as needed). It also includes more logging than we had before, listing all the failed classifiers for a gesture, along with the HistoryTracker's belief and confidence. Logs are now delayed one gesture. Instead of immediately logging when a falsing call is made, it waits until the gesture is marked as complete. This confers two advantages: 1) If multiple calls to #isFalseGesture (and similar) are made, we don't log multiple times. We only log the result once. 2) It allows us to log the effects on the HistoryTracker, as that only updates itself when the gesture is marked as completed. Bug: 172655679 Test: atest SystemUITests && manual Change-Id: I653ac2abb03a91ff000b46075e58137b04226023
* Add falsing to quick settings buttons.Dave Mankoff2021-03-111-1/+1
| | | | | | | | | | | | | | Quicksettings buttons will now reject single taps that either don't look like clean single taps or that fail other single-tap falsing criteria. However, with this change we also allow clean double taps to be recognized as single taps for the purposes of falsing. If a single tap fails, a double tap might work. Bug: 172655679 Test: atest SystemUITests && manual Change-Id: Icab57e98e2784f3c152b4496db8fc97c2235cbec
* Incorporate Bayes into Falsing.Dave Mankoff2021-03-101-1/+1
| | | | | | | | | | | | | | | | | | 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
* Fix unbounded MotionEvent growth in FalsingDave Mankoff2021-03-041-3/+1
| | | | | | | | | | | | | | | | | We were keeping an unbounded list of MotionEvents inside of the FalsingManager. Generally, this list should have shrunk itself periodically, but in practice it only shrank itself when someone double taps a notification. Meanwhile, we weren't even using the data in the list! With this change, we only keep the current and prior list of MotionEvents - the ones we actually use. The list of historical events is removed, so the leak goes with it. Fixes: 177329773 Test: atest SystemUITests && manual Change-Id: If8bfeea944850d972434915018b5bbfb3acb80e4
* Make FalsingClassifiers less stateful.Dave Mankoff2020-12-101-15/+10
| | | | | | | | | | Clasifiers now return a Result object on all their classification methods. The Result object now contains the "reason" for falsing instead of asking the Classifier for the reason after the fact. Bug: 172655679 Test: atest SystemUITests Change-Id: I0865f18cbae9367c203936fbbc3923de55c81007
* Add HistoryTracker to FalsingManagerDave Mankoff2020-12-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This institutes a HistoryTracker mechanism that will allow the FalsingManager to take recent activity into account when classifying gestures. The HistoryTracker returns a penalty that is pased to each classifier for them to use when making decisions. As of right now, no classifier actually uses the history penalty when making a classification decision. The HistoryTracker keeps records of the last 3 seconds of falsing results, applying a decaying penalty to the results over time. It also assigns a confidence to its results, based on how consistent they are. Each individual classifier is also able to return a confidence score now, such that, if they are not confident in their decision, they don't throw off the score that gets stored in the HistoryTracker. Confidences currently returned by the classifiers are somewhat arbitrary and should be adjusted in future CLs. Everything is currently open for adjustment: - The length of history - The decay function applied to history - The method by which our confidence in the history is calculated - The confidence returned by each individual classfier - How the history penalty is taken into account by each classifier - ... and probably more. Bug: 172655679 Test: atest SystemUITests Change-Id: Ief2a5144a0cda659c7d78ed6e489231d481b6872
* Add Tests for the BrightLineFalsingManager.Dave Mankoff2020-12-011-0/+114
Sets up some more dagger injection and removes all the "new Classifier(...)" from its constructor, allowing them to come from outside. Bug: 172655679 Test: atest SystemUITests Change-Id: I916de7d5ee60ec2183c6401ec222867fc5eff823