Loading services/accessibility/accessibility.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,16 @@ flag { bug: "297972548" } flag { name: "always_allow_observing_touch_events" namespace: "accessibility" description: "Always allows InputFilter observing SOURCE_TOUCHSCREEN events, even if touch exploration is enabled." bug: "344604959" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "resettable_dynamic_properties" namespace: "accessibility" Loading services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +31 −7 Original line number Diff line number Diff line Loading @@ -1087,7 +1087,15 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo } } private boolean anyServiceWantsToObserveMotionEvent(MotionEvent event) { private boolean anyServiceWantsGenericMotionEvent(MotionEvent event) { if (Flags.alwaysAllowObservingTouchEvents()) { final boolean isTouchEvent = event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN); if (isTouchEvent && !canShareGenericTouchEvent()) { return false; } 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) Loading @@ -1095,13 +1103,14 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo return false; } final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK; return (mCombinedGenericMotionEventSources & mCombinedMotionEventObservedSources & eventSourceWithoutClass) != 0; return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0; } private boolean anyServiceWantsGenericMotionEvent(MotionEvent event) { 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) Loading @@ -1109,7 +1118,22 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo return false; } final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK; return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0; return (mCombinedGenericMotionEventSources & mCombinedMotionEventObservedSources & eventSourceWithoutClass) != 0; } private boolean canShareGenericTouchEvent() { if ((mCombinedMotionEventObservedSources & InputDevice.SOURCE_TOUCHSCREEN) != 0) { // Share touch events if a MotionEvent-observing service wants them. return true; } if ((mEnabledFeatures & FLAG_FEATURE_TOUCH_EXPLORATION) == 0) { // Share touch events if touch exploration is not enabled. return true; } return false; } public void setCombinedGenericMotionEventSources(int sources) { Loading Loading
services/accessibility/accessibility.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,16 @@ flag { bug: "297972548" } flag { name: "always_allow_observing_touch_events" namespace: "accessibility" description: "Always allows InputFilter observing SOURCE_TOUCHSCREEN events, even if touch exploration is enabled." bug: "344604959" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "resettable_dynamic_properties" namespace: "accessibility" Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +31 −7 Original line number Diff line number Diff line Loading @@ -1087,7 +1087,15 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo } } private boolean anyServiceWantsToObserveMotionEvent(MotionEvent event) { private boolean anyServiceWantsGenericMotionEvent(MotionEvent event) { if (Flags.alwaysAllowObservingTouchEvents()) { final boolean isTouchEvent = event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN); if (isTouchEvent && !canShareGenericTouchEvent()) { return false; } 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) Loading @@ -1095,13 +1103,14 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo return false; } final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK; return (mCombinedGenericMotionEventSources & mCombinedMotionEventObservedSources & eventSourceWithoutClass) != 0; return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0; } private boolean anyServiceWantsGenericMotionEvent(MotionEvent event) { 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) Loading @@ -1109,7 +1118,22 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo return false; } final int eventSourceWithoutClass = event.getSource() & ~InputDevice.SOURCE_CLASS_MASK; return (mCombinedGenericMotionEventSources & eventSourceWithoutClass) != 0; return (mCombinedGenericMotionEventSources & mCombinedMotionEventObservedSources & eventSourceWithoutClass) != 0; } private boolean canShareGenericTouchEvent() { if ((mCombinedMotionEventObservedSources & InputDevice.SOURCE_TOUCHSCREEN) != 0) { // Share touch events if a MotionEvent-observing service wants them. return true; } if ((mEnabledFeatures & FLAG_FEATURE_TOUCH_EXPLORATION) == 0) { // Share touch events if touch exploration is not enabled. return true; } return false; } public void setCombinedGenericMotionEventSources(int sources) { Loading