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

Commit 9f112286 authored by Cam Bickel's avatar Cam Bickel Committed by Camden Bickel
Browse files

Cleanup flag "always_allow_observing_touch_events"

Bug: b/344604959
Test: presubmit
Flag: EXEMPT flag cleanup
Change-Id: I5cd3797f2c7004eabc4222ce6743802c26542e1a
parent 40c99aa5
Loading
Loading
Loading
Loading
+3 −26
Original line number Diff line number Diff line
@@ -1180,7 +1180,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
    }

    private boolean anyServiceWantsGenericMotionEvent(MotionEvent event) {
        if (Flags.alwaysAllowObservingTouchEvents()) {
        final boolean isTouchEvent = event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN);
        if (isTouchEvent && !canShareGenericTouchEvent()) {
            return false;
@@ -1188,33 +1187,11 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
        final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK;
        return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0;
    }
        // Disable SOURCE_TOUCHSCREEN generic event interception if any service is performing
        // touch exploration.
        if (event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)
                && (mEnabledFeatures & FLAG_FEATURE_TOUCH_EXPLORATION) != 0) {
            return false;
        }
        final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK;
        return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0;
    }

    private boolean anyServiceWantsToObserveMotionEvent(MotionEvent event) {
        if (Flags.alwaysAllowObservingTouchEvents()) {
        final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK;
        return (mCombinedMotionEventObservedSources & eventSourceWithoutClass) != 0;
    }
        // Disable SOURCE_TOUCHSCREEN generic event interception if any service is performing
        // touch exploration.
        if (event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)
                && (mEnabledFeatures & FLAG_FEATURE_TOUCH_EXPLORATION) != 0) {
            return false;
        }
        final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK;
        return (mCombinedGenericMotionEventSources
                & mCombinedMotionEventObservedSources
                & eventSourceWithoutClass)
                != 0;
    }

    private boolean canShareGenericTouchEvent() {
        if ((mCombinedMotionEventObservedSources & InputDevice.SOURCE_TOUCHSCREEN) != 0) {