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

Commit a83d1ca7 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Only filter a11y motion events if needed.

am: dc5dedea

Change-Id: I51ac5e276935d3fec60de7dbf1ad9f005180f7e5
parents bfacf7ce dc5dedea
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
     */
    static final int FLAG_FEATURE_INJECT_MOTION_EVENTS = 0x00000010;

    static final int FEATURES_AFFECTING_MOTION_EVENTS = FLAG_FEATURE_INJECT_MOTION_EVENTS
            | FLAG_FEATURE_AUTOCLICK | FLAG_FEATURE_TOUCH_EXPLORATION
            | FLAG_FEATURE_SCREEN_MAGNIFIER;
    /**
     * Flag for enabling the feature to control the screen magnifier. If
     * {@link #FLAG_FEATURE_SCREEN_MAGNIFIER} is set this flag is ignored
@@ -203,8 +206,13 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
        }

        if (event instanceof MotionEvent) {
            if ((mEnabledFeatures & FEATURES_AFFECTING_MOTION_EVENTS) != 0) {
                MotionEvent motionEvent = (MotionEvent) event;
                processMotionEvent(state, motionEvent, policyFlags);
                return;
            } else {
                super.onInputEvent(event, policyFlags);
            }
        } else if (event instanceof KeyEvent) {
            KeyEvent keyEvent = (KeyEvent) event;
            processKeyEvent(state, keyEvent, policyFlags);