Merge "Only filter a11y motion events if needed." into nyc-mr1-dev
This commit is contained in:
@@ -77,6 +77,9 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
|
|||||||
*/
|
*/
|
||||||
static final int FLAG_FEATURE_INJECT_MOTION_EVENTS = 0x00000010;
|
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
|
* Flag for enabling the feature to control the screen magnifier. If
|
||||||
* {@link #FLAG_FEATURE_SCREEN_MAGNIFIER} is set this flag is ignored
|
* {@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 (event instanceof MotionEvent) {
|
||||||
MotionEvent motionEvent = (MotionEvent) event;
|
if ((mEnabledFeatures & FEATURES_AFFECTING_MOTION_EVENTS) != 0) {
|
||||||
processMotionEvent(state, motionEvent, policyFlags);
|
MotionEvent motionEvent = (MotionEvent) event;
|
||||||
|
processMotionEvent(state, motionEvent, policyFlags);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
super.onInputEvent(event, policyFlags);
|
||||||
|
}
|
||||||
} else if (event instanceof KeyEvent) {
|
} else if (event instanceof KeyEvent) {
|
||||||
KeyEvent keyEvent = (KeyEvent) event;
|
KeyEvent keyEvent = (KeyEvent) event;
|
||||||
processKeyEvent(state, keyEvent, policyFlags);
|
processKeyEvent(state, keyEvent, policyFlags);
|
||||||
|
|||||||
Reference in New Issue
Block a user