diff options
| author | 2018-04-28 09:45:49 -0700 | |
|---|---|---|
| committer | 2018-04-28 09:45:49 -0700 | |
| commit | 90c7dd7166fb1701e9d1a8b150fb9cadf13fc757 (patch) | |
| tree | fcaed08efe65bf27cdb4db91de5c7193e2c50b1d | |
| parent | 86b04a7ecf752a159edf68c9aef6c74768f5ac86 (diff) | |
| parent | 4432404fec5af005ca95d41d9e68d24f7c127501 (diff) | |
Merge "FalsingManager: Only use for touchscreen input" into pi-dev am: 216eea7470
am: 4432404fec
Change-Id: I6f7c9b4630f01941a933fd04e552a8356a3e7247
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java index 913e7819b7fa..a265a5e1d5a7 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java @@ -28,6 +28,7 @@ import android.os.Looper; import android.os.PowerManager; import android.os.UserHandle; import android.provider.Settings; +import android.view.InputDevice; import android.view.MotionEvent; import android.view.accessibility.AccessibilityManager; @@ -74,6 +75,7 @@ public class FalsingManager implements SensorEventListener { private boolean mEnforceBouncer = false; private boolean mBouncerOn = false; private boolean mSessionActive = false; + private boolean mIsTouchScreen = true; private int mState = StatusBarState.SHADE; private boolean mScreenOn; private boolean mShowingAod; @@ -236,6 +238,11 @@ public class FalsingManager implements SensorEventListener { // already sufficiently prevents false unlocks. return false; } + if (!mIsTouchScreen) { + // Unlocking with input devices besides the touchscreen should already be sufficiently + // anti-falsed. + return false; + } return mHumanInteractionClassifier.isFalseTouch(); } @@ -450,6 +457,9 @@ 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); |