Merge "Remove exception for injecting pointer event from sendTrackballEventSync" into tm-dev

This commit is contained in:
Prabir Pradhan
2022-04-06 14:36:57 +00:00
committed by Android (Google) Code Review

View File

@@ -1207,11 +1207,6 @@ public class Instrumentation {
*/ */
public void sendTrackballEventSync(MotionEvent event) { public void sendTrackballEventSync(MotionEvent event) {
validateNotAppThread(); validateNotAppThread();
if (event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) {
throw new IllegalArgumentException(
"Cannot inject pointer events from sendTrackballEventSync()."
+ " Use sendPointerSync() to inject pointer events.");
}
if (!event.isFromSource(InputDevice.SOURCE_CLASS_TRACKBALL)) { if (!event.isFromSource(InputDevice.SOURCE_CLASS_TRACKBALL)) {
event.setSource(InputDevice.SOURCE_TRACKBALL); event.setSource(InputDevice.SOURCE_TRACKBALL);
} }