Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 216eea74 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "FalsingManager: Only use for touchscreen input" into pi-dev

parents eb12f6a5 004437e5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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);