Merge "Dispatch accessibility gesture if device supports touch" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-02-09 05:36:36 +00:00
committed by Android (Google) Code Review
4 changed files with 13 additions and 16 deletions

View File

@@ -372,12 +372,11 @@ class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnect
@Override
public void dispatchGesture(int sequence, ParceledListSlice gestureSteps, int displayId) {
final boolean isTouchableDisplay = mWindowManagerService.isTouchableDisplay(displayId);
synchronized (mLock) {
if (mSecurityPolicy.canPerformGestures(this)) {
MotionEventInjector motionEventInjector =
mSystemSupport.getMotionEventInjectorForDisplayLocked(displayId);
if (motionEventInjector != null && isTouchableDisplay) {
if (mWindowManagerService.isTouchOrFaketouchDevice()) {
motionEventInjector.injectEvents(
gestureSteps.getList(), mServiceInterface, sequence, displayId);
} else {