summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Don't skip falsing on non-foldable devicesAndrás Kurucz2023-02-161-1/+1
| | | | | | | | | In ag/20887962 we introduced a way to skip checking for false touches, when a foldable device is unfolded. The problem is that this CL also disabled the falsing checks on non-foldable devices. Fixes: 269594643 Test: atest BrightLineClassifierTest BrightLineFalsingManagerTest FalsingDataProviderTest Test: enable FalsingManager logs, check if falsing is skipped on foldable and non-foldable devices. Change-Id: I99ee7b717f0a417065655ccc3a0602839f44e40a
* Skip falsing on unfolded devices.Dave Mankoff2023-01-111-2/+5
| | | | | | | | | Exposes the already-known folded state on FoldStateListener such that it can be queried when needed. Bug: 236197248 Test: manually on a foldable && atest SystemUITests Change-Id: I1bca6254b7e8528e0a999d8f171e0ee1f966aeb4
* Increasing Penalty on UMO tapsMichael Mikhail2022-11-141-1/+2
| | | | | | | | | | Increase penalty from low to moderate for action buttons and seekbar in UMO because they have a big impact on the user experience. Bug: 241487855. Test: atest MediaControlPanelTest. Test: atest SeekbarViewModelTest. Change-Id: I1186b9a8da6fd3f53b69ec17cca282399d630601
* Adding isFalseLongTap methodMichael Mikhail2022-11-031-3/+63
| | | | | | | | | | Adds isFalseLongTap method and makes an absract class for SingleTap and LongTap as they only differ in touch slop. Bug: 241487855 Test: atest BrightLineClassifierTest Test: atest BrightLineFalsingManagerTest Change-Id: Ia606afe2ebe5c454bcc74294210ced52f63e33ef
* [User Switcher] Remove falsing check for a11y.Aaron Liu2022-10-281-1/+2
| | | | | | | | | | | | The user switcher on the bouncer has a bunch of falsing checks. Check to see if the click that is performed is from an accessibility action. If this is the case, we do not perform a falsing check. Test: Add a unit test. Used voice access and switch access to open the user switcher and select an item in that list. Bug: 221370490, 222211112 Change-Id: Ie9fce53ce11b68dc10f5c2513d3c6a600c51fafa
* Check False tap within False touch in SeekBarMichael Mikhail2022-10-131-0/+6
| | | | | | | | | | This CL checks for false tap if the interaction type is MEDIA_SEEKBAR. It makes sure that SeekBar is protected from any false interactions. Bug: 241487855 Test: atest BrightLineClassifierTest. Test: atest SeekBarViewModelTest. Change-Id: I3525f549ac07c833ab5a73a04a2b0d8d42a37fda
* Analyze vertical swipes on QS's Scroll View.Dave Mankoff2022-09-201-1/+7
| | | | | | | | | | | | | | | | | When media controls are shown, the full qs+media controls often takes up more than one full screen. Swiping up on this causes the qs to vertically scroll instead of collapse. Prior to this cl, we weren't analyzing such swipes in the FalsingManager. Now we do. No explicit action is taken in the event of a false swipe. It simply gives us more signal. Enough bad swipes may implicitly cause the lock screen to reset itself. Fixes: 241708312 Test: manual Change-Id: I5adfb3a22b2f0f51efb87d56a6cfc5459cd67006
* Wakeup display on taps before entering true AoDBeverly2022-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this transition state, the device is not technically pulsing, but it is Dozing. The primary difference is that the display state is the display is still ON (not DISPLAY_STATE_DOZE) and the DozeSensor wake gestures aren't registered yet. Because isPulsing=false during this transition, instead of checking isPulsing, check isDozing instead. Only touches when the display is ON get sent through the NotificationShadeWindowViewController => PulsingGestureListener, so the DozeSensors will still handle the wakeups that aren't fake AoD2 (including both pulsing + transition period). This CL: - updates the PulsingGestureListener to only check the falsing manager on the ACTION_UP event of the single tap and double tap gesture. The FalsingManager only works if checked right after the action occurred. Previously, we'd check double taps on the double tap's ACTION_DOWN. - allows the FalsingManager to analyze taps from the NotificationPanel while Dozing, as to include the taps when the device is transitioning to AoD. When the device enters the display state DOZE, taps will no longer be sent to the NotificationPanel. - removes the vibration when DOZING that goes along with the falsing manager's feedback when an additional tap is required. if the device is dozing, its likely the device may be in the pocket so there's no reason to buzz. Test: manual 1. Enable AoD 2. Power off display 3. Tap display right after power off 4. Observe: device wakes up to LS Test: manual 1. Disable AoD 2. Send a delayed (5000ms) high-priority notification 3. Screen off 4. When the notification shows, tap the screen 5. Observe: device wakes up to LS Test: atest PulsingGestureListenerTest NotificationPanelViewControllerTest Fixes: 246722709 Bug: 244659326 Bug: 242125976 Change-Id: I1330f2c87482d8bc743a61d652d245fd9b4c69a0
* Add falsing protection to the pulsing stateBeverly2022-08-261-0/+8
| | | | | | | | | | | | | | Prox-gate the tap and double tap to wake gestures from pulsing/AoD2. Enable FalsingCollector logs: adb shell setprop log.tag.FalsingCollector DEBUG Test: manually trigger quickpickup (or receive a notification on AoD), cover the prox sensor, and then tap the screen - see device won't wake up Test: atest NotificationShadeWindowViewControllerTest BrightLineFalsingManagerTest PulsingGestureListenerTest Fixes: 242125976 Change-Id: I520df509b7804d765807477968257c94f55ef634
* Remove FileDescriptor from systemui.Dumpable.Dave Mankoff2022-04-051-2/+1
| | | | | | | | | | This is the first step in moving over to the new public android.util.Dumpable api. Bug: 217567642 Test: m SystemUI Merged-In: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0 Change-Id: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0
* Fix FalsingManager when a11y is on.Dave Mankoff2021-10-151-1/+1
| | | | | | | | | | Replaces AccessibilityManager.isEnabled() with AccessibilityManager.isTouchExplorationEnabled(), which is more correct. The wrong method was selected when it was first checked in. Fixes: 203034281 Test: manual Change-Id: Ic73d535df98a15e0771fb394e91d2191f834f5c2
* Use DockManager instead of BatteryController for Falsing.Dave Mankoff2021-07-021-6/+3
| | | | | | | | | | Also, pause the proximity sensor directly when we dock/undock. This ensures that we don't wait for some other event to occur before changing the state of the proximity sensor. Fixes: 192670703 Test: atest SystemUITests Change-Id: If2b429639df76bbd4cf8adecc987dcf18ae45925
* Ensure that falsing is turned off when a11y is on.Dave Mankoff2021-06-301-1/+6
| | | | | | Fixes: 192111575 Test: manual Change-Id: Ie2fc70b4079c7bb429cf9511574aa898f611ed3a
* Don't destroy the FalsingManager in Wallet.Dave Mankoff2021-06-021-1/+18
| | | | | | | | | | | When FalsingManager#cleanupInternal is called, it no longer produces valid results. With this change, we check that the FalsingManager is not used after being destroyed, and also avoid destroying it in WalletScreenController. Fixes: 188174214 Test: manual Change-Id: I0ce67de5a326b56dee11c1d63c1d592640c0713d
* Mkae SysUIPlugins its own gradle target.Dave Mankoff2021-04-301-2/+1
| | | | | | | | | Breaks the dependency of SystemUIPlugins on ThresholdSensor by introducing an intermediate interface. Fixes: 186781915 Test: manual Change-Id: Ib2633f8f2acaa1d21f1e8968317b4a4e63d3af32
* Recognize the Back Gesture in the FalsingManager.Dave Mankoff2021-04-271-5/+8
| | | | | | | | | Remove calls to Dependency.get from EdgeBackGestureHandler, making it injectable. Bug: 186011223 Test: manual Change-Id: I3d5e6b27f6afa46dcee88b6818f0b19722181421
* Merge "Ensure that the FalsingManager skips falsing when appropriate." into ↵Dave Mankoff2021-04-271-22/+27
|\ | | | | | | sc-dev
| * Ensure that the FalsingManager skips falsing when appropriate.Dave Mankoff2021-04-261-22/+27
| | | | | | | | | | | | | | | | Copies the logic from isFalseTouch to isFalseTap and isFalseDoubleTap. Fixes: 186218339 Test: atest SystemUITests && manual Change-Id: Ic0fdcc9880eaaf3597beee9f0fa634dc49214fbd
* | Make FalsingManager send out an event when second tap is required.Dave Mankoff2021-04-231-0/+12
|/ | | | | | Bug: 185908806 Test: manual Change-Id: I33b704b0f5b4fded59214ab33dbafc8de89675ad
* Increase gesture completion delay for falsing.Dave Mankoff2021-04-211-1/+7
| | | | | | | | | | | | | | | The FalsingManager was hitting a race condition with View click listeners, where clicks would still, somtimes come in after the FalsingManager had already marked the gesture as un-analyzed. Increasing the delay from 50ms to 100ms should all but prevent that from happening. I have also decreased the penalty for unalayzed taps since accidentally tapping on the wrong part of the screen is not unlikely. Fixes: 185212498 Test: manual Change-Id: I91e1e9152536a36eda74b5fd60051acc78434761
* Separate out FalsingManager#isFalseTapDave Mankoff2021-04-071-3/+28
| | | | | | | | | | | | | 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
* Ensure that FalsingManager#isFalseTap handles delayed clicks.Dave Mankoff2021-04-061-1/+3
| | | | | | | | | | | | | | Views, be default, don't immediately process touch events as clicks. Instead, they post an internal runnable to the main thread that then runs the click. This was tripping up the FalsingManager, as a recent change meant that it no longer saw the motion events. With this change, the FalsingManager will look at prior events if the recent events are empty. Fixes: 184635871 Test: manual Change-Id: I69981b09837d8a1d94b3a033243bce7a2d31844c
* Move Falsing debug records to gesture finalization.Dave Mankoff2021-03-231-38/+44
| | | | | | | | | | | | Renames onGestureComplete to onGestureFinalized to be more clear about the purpose that the message serves. Prior to this change, debug swipe records might be recorded mulptile times. Bug: 172655679 Test: manual Change-Id: I334866f981ce0f4153f207e096b27eadfc1251ee
* Add more logging for falsing.Dave Mankoff2021-03-181-50/+45
| | | | | | | | | | | | | | | | | | | | | | 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
* Merge changes from topic "b172655679-bayes-falsing" into sc-devDave Mankoff2021-03-171-13/+35
|\ | | | | | | | | | | * changes: Rely on a falsing-belief event to reset lockscreen Track Falsing on Notification Taps.
| * Rely on a falsing-belief event to reset lockscreenDave Mankoff2021-03-151-13/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Individual components of the lock screen are now simply in charge of asking the FalsingManager to recognize certain types of gestures. If they don't ask, the FalsingManager will assume they were accidental. Once a certain number of accidental touches occur, an event is fired that signals that the lock screen should be reset. More tuning and adjustment to come, but this is now functional. This also fixes a bug in an earlier cl where the bouncer would no longer retract if touches outside of its region were detected. Bug: 172655679 Test: manual Change-Id: Iffd1c7e58365235b1b7dbdac0c74439ead1df9d3
* | Avoid falsing when the phone is unlocked.Dave Mankoff2021-03-151-1/+21
|/ | | | | | | | | | With this change, we completely avoid recording motion events when the phone is off the lock screen. We also also return false when asked if the last gesture was a false. Fixes: 182713255 Test: atest SystemUITests && manual Change-Id: I2e16aecb218dd3c862ffefc8c82f67523925ac5e
* Add falsing to quick settings buttons.Dave Mankoff2021-03-111-3/+8
| | | | | | | | | | | | | | 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-44/+17
| | | | | | | | | | | | | | | | | | 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
* Connect FalsingManager to HistoryTracker.Dave Mankoff2021-01-051-37/+93
| | | | | | | | | | | | | | With this change, the analysis of gestures actually gets added to our HistoryTracker. Prior to this, HistoryTracker was only ever being exercised in tests. The one trick that this addresses is that invalid single-taps can't immediately be added to the HistoryTracker, as they may become _valid_ double taps. We don't want double taps to be penalized. Bug: 172655679 Test: atest SystemUITests Change-Id: I2e5ece6af82eb20f053b6b17298dcd9002236e39
* Make FalsingClassifiers less stateful.Dave Mankoff2020-12-101-10/+12
| | | | | | | | | | 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-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+339
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