summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
index a265a5e1d5a7..0ca0a117f6e6 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java
@@ -74,6 +74,7 @@ public class FalsingManager implements SensorEventListener {
private boolean mEnforceBouncer = false;
private boolean mBouncerOn = false;
+ private boolean mBouncerOffOnDown = false;
private boolean mSessionActive = false;
private boolean mIsTouchScreen = true;
private int mState = StatusBarState.SHADE;
@@ -459,10 +460,19 @@ public class FalsingManager implements SensorEventListener {
public void onTouchEvent(MotionEvent event, int width, int height) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
mIsTouchScreen = event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN);
- }
- if (mSessionActive && !mBouncerOn) {
- mDataCollector.onTouchEvent(event, width, height);
- mHumanInteractionClassifier.onTouchEvent(event);
+ // If the bouncer was not shown during the down event,
+ // we want the entire gesture going to HumanInteractionClassifier
+ mBouncerOffOnDown = !mBouncerOn;
+ }
+ if (mSessionActive) {
+ if (!mBouncerOn) {
+ // In case bouncer is "visible", but onFullyShown has not yet been called,
+ // avoid adding the event to DataCollector
+ mDataCollector.onTouchEvent(event, width, height);
+ }
+ if (mBouncerOffOnDown) {
+ mHumanInteractionClassifier.onTouchEvent(event);
+ }
}
}