fix(touchexplorer): Avoid conflicts with real and TouchExplorer events by using a virtual device id
InputDispatcher's touch streams track touch state consistency separately for each device id. Using a virtual device id for TouchExplorer, like we already do for MotionEventInjector, ensures that these events do not clash with real touchscreen events that happened before the input filter was enabled. If a real pointer is on screen when TouchExplorer starts then InputDispatcher will automatically clear that real deviceId's pointer state when it sees an event from the new virtual deviceId on the same display. (Note: device id != display id. Real and injected events target the same display, but use different device ids to indicate who made the event.) Bug: 364408887 Test: manually use touch exploration and observe issue in bug is gone Test: atest com.android.server.accessibility.gestures.TouchExplorerTest Test: atest android.accessibilityservice.cts.TouchExplorerTest Flag: com.android.server.accessibility.touch_explorer_use_virtual_device_id Change-Id: I223d50bf9ce53e0ff366f43d2f913c7d119b789d
Loading
Please register or sign in to comment