/cts/tests/tests/view/src/android/view/cts/input/ |
D | InputEventTest.java | 25 import android.view.MotionEvent; 57 axes.put(MotionEvent.AXIS_X, "AXIS_X"); in testAxisFromToString() 58 axes.put(MotionEvent.AXIS_Y, "AXIS_Y"); in testAxisFromToString() 59 axes.put(MotionEvent.AXIS_PRESSURE, "AXIS_PRESSURE"); in testAxisFromToString() 60 axes.put(MotionEvent.AXIS_SIZE, "AXIS_SIZE"); in testAxisFromToString() 61 axes.put(MotionEvent.AXIS_TOUCH_MAJOR, "AXIS_TOUCH_MAJOR"); in testAxisFromToString() 62 axes.put(MotionEvent.AXIS_TOUCH_MINOR, "AXIS_TOUCH_MINOR"); in testAxisFromToString() 63 axes.put(MotionEvent.AXIS_TOOL_MAJOR, "AXIS_TOOL_MAJOR"); in testAxisFromToString() 64 axes.put(MotionEvent.AXIS_TOOL_MINOR, "AXIS_TOOL_MINOR"); in testAxisFromToString() 65 axes.put(MotionEvent.AXIS_ORIENTATION, "AXIS_ORIENTATION"); in testAxisFromToString() [all …]
|
D | InputEventInterceptTestActivity.java | 21 import android.view.MotionEvent; 28 final BlockingQueue<MotionEvent> mMotionEvents = new LinkedBlockingQueue<>(); 37 public boolean dispatchGenericMotionEvent(MotionEvent event) { in dispatchGenericMotionEvent() 43 public boolean dispatchTouchEvent(MotionEvent event) { in dispatchTouchEvent()
|
/cts/tests/tests/view/src/android/view/cts/ |
D | MotionEventTest.java | 35 import android.view.MotionEvent; 36 import android.view.MotionEvent.PointerCoords; 37 import android.view.MotionEvent.PointerProperties; 58 private MotionEvent mMotionEvent1; 59 private MotionEvent mMotionEvent2; 60 private MotionEvent mMotionEventDynamic; 71 private static final int EDGE_FLAGS = MotionEvent.EDGE_TOP; 75 private static native void nativeMotionEventTest(MotionEvent event); in nativeMotionEventTest() 85 mMotionEvent1 = MotionEvent.obtain(mDownTime, mEventTime, in setup() 86 MotionEvent.ACTION_MOVE, X_3F, Y_4F, META_STATE); in setup() [all …]
|
D | TouchDelegateTest.java | 28 import android.view.MotionEvent; 86 dispatchTouchEventToActivity(MotionEvent.ACTION_DOWN, mActivity.touchDelegateY, in testCancelEvent() 88 dispatchTouchEventToActivity(MotionEvent.ACTION_CANCEL, mActivity.touchDelegateY, in testCancelEvent() 92 ensureOldestActionEquals(MotionEvent.ACTION_DOWN); in testCancelEvent() 93 ensureOldestActionEquals(MotionEvent.ACTION_CANCEL); in testCancelEvent() 105 dispatchTouchEventToActivity(MotionEvent.ACTION_DOWN, mActivity.touchDelegateY, downTime); in testTwoPointers() 106 dispatchTouchEventToActivity(MotionEvent.ACTION_MOVE, mActivity.touchDelegateY, downTime); in testTwoPointers() 108 (1 << MotionEvent.ACTION_POINTER_INDEX_SHIFT) + MotionEvent.ACTION_POINTER_DOWN; in testTwoPointers() 111 dispatchMultiTouchMotionEventToActivity(MotionEvent.ACTION_MOVE, 2, in testTwoPointers() 114 (1 << MotionEvent.ACTION_POINTER_INDEX_SHIFT) + MotionEvent.ACTION_POINTER_UP; in testTwoPointers() [all …]
|
D | MotionEventUtils.java | 21 import android.view.MotionEvent; 22 import android.view.MotionEvent.PointerCoords; 23 import android.view.MotionEvent.PointerProperties; 57 public void verifyMatches(MotionEvent that, int pointerIndex) { in verifyMatches() 69 public void verifyMatchesPointerProperties(MotionEvent motionEvent, int pointerIndex) { in verifyMatchesPointerProperties() 129 public void verifyMatches(MotionEvent that) { in verifyMatches() 132 that.getAxisValue(MotionEvent.AXIS_X), this.x, DELTA); in verifyMatches() 136 that.getAxisValue(MotionEvent.AXIS_Y), this.y, DELTA); in verifyMatches() 140 that.getAxisValue(MotionEvent.AXIS_PRESSURE), this.pressure, DELTA); in verifyMatches() 144 that.getAxisValue(MotionEvent.AXIS_SIZE), this.size, DELTA); in verifyMatches() [all …]
|
D | ViewUnbufferedTest.java | 34 import android.view.MotionEvent; 90 private final BlockingQueue<MotionEvent> mSentEvents = new LinkedBlockingQueue<>(); 144 private static void compareEvent(final MotionEvent sentEvent, in compareEvent() 153 private void compareEvents(final BlockingQueue<MotionEvent> sentEvents, in compareEvents() 158 MotionEvent sentEvent = sentEvents.poll(); in compareEvents() 182 MotionEvent downEvent = in sendPointerEvents() 183 MotionEvent.obtain(downTime, downTime, actions[0], x, y, 0); in sendPointerEvents() 197 final MotionEvent moveEvent = MotionEvent.obtain(downTime, eventTime, in sendPointerEvents() 205 final MotionEvent upEvent = MotionEvent.obtain(downTime, SystemClock.uptimeMillis(), in sendPointerEvents() 223 final MotionEvent moveEvent = MotionEvent.obtain(eventTime, eventTime, in sendJoystickEvents() [all …]
|
D | MotionEvent_PointerCoordsTest.java | 21 import android.view.MotionEvent; 38 private MotionEvent.PointerCoords mPointerCoords; 55 mPointerCoords.setAxisValue(MotionEvent.AXIS_X, 15.0f); in testAxesModifications() 60 mPointerCoords.setAxisValue(MotionEvent.AXIS_Y, 25.0f); in testAxesModifications() 65 mPointerCoords.setAxisValue(MotionEvent.AXIS_PRESSURE, 2.2f); in testAxesModifications() 70 mPointerCoords.setAxisValue(MotionEvent.AXIS_SIZE, 10.0f); in testAxesModifications() 75 mPointerCoords.setAxisValue(MotionEvent.AXIS_TOOL_MAJOR, 7.0f); in testAxesModifications() 80 mPointerCoords.setAxisValue(MotionEvent.AXIS_TOOL_MINOR, 2.0f); in testAxesModifications() 85 mPointerCoords.setAxisValue(MotionEvent.AXIS_TOUCH_MAJOR, 5.0f); in testAxesModifications() 90 mPointerCoords.setAxisValue(MotionEvent.AXIS_TOUCH_MINOR, 2.1f); in testAxesModifications() [all …]
|
D | MotionEvent_PointerPropertiesTest.java | 21 import android.view.MotionEvent; 37 private MotionEvent.PointerProperties mPointerProperties; 41 mBuilder = withProperties(3, MotionEvent.TOOL_TYPE_MOUSE); in setup() 52 final MotionEvent.PointerProperties pointerProperties = new MotionEvent.PointerProperties(); in testCopyFrom() 60 withProperties(MotionEvent.INVALID_POINTER_ID, MotionEvent.TOOL_TYPE_UNKNOWN). in testClear()
|
D | VerifyInputEventTest.java | 23 import static android.view.MotionEvent.FLAG_WINDOW_IS_OBSCURED; 24 import static android.view.MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED; 40 import android.view.MotionEvent; 159 MotionEvent downEvent = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, in testMotionEvent() 162 MotionEvent received = waitForMotion(); in testMotionEvent() 169 MotionEvent upEvent = MotionEvent.obtain(downTime, SystemClock.uptimeMillis(), in testMotionEvent() 170 MotionEvent.ACTION_UP, point.x, point.y, 0 /*metaState*/); in testMotionEvent() 185 MotionEvent downEvent = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, in testMotionEventWithoutHmac() 193 MotionEvent upEvent = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_UP, in testMotionEventWithoutHmac() 208 MotionEvent downEvent = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_DOWN, in testTamperedMotionEvent() [all …]
|
D | GestureDetectorCtsActivity.java | 28 import android.view.MotionEvent; 49 doReturn(true).when(mOnGestureListener).onDown(any(MotionEvent.class)); in onCreate() 50 doReturn(true).when(mOnGestureListener).onFling(any(MotionEvent.class), in onCreate() 51 any(MotionEvent.class), anyFloat(), anyFloat()); in onCreate() 52 doReturn(true).when(mOnGestureListener).onScroll(any(MotionEvent.class), in onCreate() 53 any(MotionEvent.class), anyFloat(), anyFloat()); in onCreate() 54 doReturn(true).when(mOnGestureListener).onSingleTapUp(any(MotionEvent.class)); in onCreate() 93 public boolean onTouch(View v, MotionEvent event) { in onTouch() 98 public boolean onGenericMotion(View v, MotionEvent event) { in onGenericMotion()
|
D | GestureDetectorTest.java | 31 import android.view.MotionEvent; 56 private MotionEvent mButtonPressPrimaryMotionEvent; 57 private MotionEvent mButtonPressSecondaryMotionEvent; 71 mButtonPressPrimaryMotionEvent = MotionEvent.obtain(mDownTime, mEventTime, in setup() 72 MotionEvent.ACTION_BUTTON_PRESS, X_3F, Y_4F, 0); in setup() 73 mButtonPressPrimaryMotionEvent.setActionButton(MotionEvent.BUTTON_STYLUS_PRIMARY); in setup() 75 mButtonPressSecondaryMotionEvent = MotionEvent.obtain(mDownTime, mEventTime, in setup() 76 MotionEvent.ACTION_BUTTON_PRESS, X_3F, Y_4F, 0); in setup() 77 mButtonPressSecondaryMotionEvent.setActionButton(MotionEvent.BUTTON_SECONDARY); in setup() 108 verify(mListener, never()).onContextClick(any(MotionEvent.class)); in testOnSetContextClickListener()
|
D | PointerCaptureTest.java | 40 import android.view.MotionEvent; 120 mockListener.onCapturedPointer(v, MotionEvent.obtain(event)); in installCapturedPointerListener() 130 private void injectMotionEvent(MotionEvent event) { in injectMotionEvent() 144 private static MotionEvent obtainRelativeMouseEvent(int action, int x, int y) { in obtainRelativeMouseEvent() 146 MotionEvent event = MotionEvent.obtain(eventTime, eventTime, action, x, y, 0); in obtainRelativeMouseEvent() 163 injectMotionEvent(obtainMouseEvent(MotionEvent.ACTION_HOVER_MOVE, mInner, 0, 0)); in verifyHoverDispatch() 164 injectMotionEvent(obtainMouseEvent(MotionEvent.ACTION_HOVER_MOVE, mTarget, 0, 0)); in verifyHoverDispatch() 165 injectMotionEvent(obtainMouseEvent(MotionEvent.ACTION_HOVER_MOVE, mTarget2, 0, 0)); in verifyHoverDispatch() 276 injectRelativeMouseEvent(MotionEvent.ACTION_MOVE, 1, 2); in testEventDispatch() 277 injectRelativeMouseEvent(MotionEvent.ACTION_DOWN, 1, 2); in testEventDispatch() [all …]
|
D | ScaleGestureDetectorTest.java | 24 import android.view.MotionEvent; 109 performTouch(MotionEvent.ACTION_DOWN, xValue, startY); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 110 performTouch(MotionEvent.ACTION_UP, xValue, startY); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 111 performTouch(MotionEvent.ACTION_DOWN, xValue, startY); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 112 performTouch(MotionEvent.ACTION_MOVE, xValue, startY + slopRadius + 1); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 114 performTouch(MotionEvent.ACTION_MOVE, xValue, startY + slopRadius - 1); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 116 performTouch(MotionEvent.ACTION_MOVE, xValue, startY + slopRadius - 2); in testGetScaleFactor_whenGestureCrossesBackInsideSlopRadius_returns1() 120 mScaleGestureDetector.onTouchEvent(MotionEvent.obtain(0L, mFakeUptimeMs, action, x, y, 0)); in performTouch()
|
/cts/tests/tests/systemui/src/android/systemui/cts/ |
D | TouchHelper.java | 24 import android.view.MotionEvent; 55 MotionEvent event = getMotionEvent(mDownTime, mDownTime, MotionEvent.ACTION_DOWN, x, y); in touchDown() 61 MotionEvent event = getMotionEvent(mDownTime, eventTime, MotionEvent.ACTION_UP, x, y); in touchUp() 66 private static MotionEvent getMotionEvent(long downTime, long eventTime, int action, in getMotionEvent() 69 MotionEvent.PointerProperties properties = new MotionEvent.PointerProperties(); in getMotionEvent() 71 properties.toolType = MotionEvent.TOOL_TYPE_FINGER; in getMotionEvent() 73 MotionEvent.PointerCoords coords = new MotionEvent.PointerCoords(); in getMotionEvent() 79 return MotionEvent.obtain(downTime, eventTime, action, 1, in getMotionEvent() 80 new MotionEvent.PointerProperties[] { properties }, in getMotionEvent() 81 new MotionEvent.PointerCoords[] { coords }, in getMotionEvent()
|
/cts/tests/tests/view/src/android/view/cts/util/ |
D | EventUtils.java | 21 import android.view.MotionEvent; 25 public static MotionEvent generateMouseEvent(int x, int y, int eventType, int buttonState) { in generateMouseEvent() 27 MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[1]; in generateMouseEvent() 28 pointerCoords[0] = new MotionEvent.PointerCoords(); in generateMouseEvent() 32 MotionEvent.PointerProperties[] pp = new MotionEvent.PointerProperties[1]; in generateMouseEvent() 33 pp[0] = new MotionEvent.PointerProperties(); in generateMouseEvent() 36 return MotionEvent.obtain(0, SystemClock.uptimeMillis(), eventType, 1, pp, in generateMouseEvent()
|
/cts/tests/accessibilityservice/src/android/accessibilityservice/cts/utils/ |
D | EventCapturingHoverListener.java | 19 import static android.view.MotionEvent.ACTION_HOVER_MOVE; 26 import android.view.MotionEvent; 38 private final BlockingQueue<MotionEvent> mEvents = new LinkedBlockingQueue<>(); 49 public boolean onHover(View view, MotionEvent MotionEvent) { in onHover() argument 50 assertTrue(mEvents.offer(MotionEvent.obtain(MotionEvent))); in onHover() 58 MotionEvent event = mEvents.poll(waitTime, SECONDS); in assertNonePropagated() 72 MotionEvent ev; in assertPropagated() 78 expected.add(MotionEvent.actionToString(e)); in assertPropagated() 85 received.add(MotionEvent.actionToString(ev.getActionMasked())); in assertPropagated() 90 received.add(MotionEvent.actionToString(action)); in assertPropagated() [all …]
|
D | EventCapturingTouchListener.java | 19 import static android.view.MotionEvent.ACTION_MOVE; 29 import android.view.MotionEvent; 42 private final BlockingQueue<MotionEvent> events = new LinkedBlockingQueue<>(); 53 public boolean onTouch(View view, MotionEvent motionEvent) { in onTouch() 54 assertTrue(events.offer(MotionEvent.obtain(motionEvent))); in onTouch() 61 MotionEvent event = events.poll(MIN_WAIT_TIME_SECONDS, SECONDS); in assertNonePropagated() 75 MotionEvent ev; in assertPropagated() 80 expected.add(MotionEvent.actionToString(e)); in assertPropagated() 88 received.add(MotionEvent.actionToString(ev.getActionMasked())); in assertPropagated() 93 received.add(MotionEvent.actionToString(action)); in assertPropagated() [all …]
|
D | GestureUtils.java | 27 import android.view.MotionEvent; 40 public static final Matcher<MotionEvent> IS_ACTION_DOWN = 41 new MotionEventActionMatcher(MotionEvent.ACTION_DOWN); 42 public static final Matcher<MotionEvent> IS_ACTION_POINTER_DOWN = 43 new MotionEventActionMatcher(MotionEvent.ACTION_POINTER_DOWN); 44 public static final Matcher<MotionEvent> IS_ACTION_UP = 45 new MotionEventActionMatcher(MotionEvent.ACTION_UP); 46 public static final Matcher<MotionEvent> IS_ACTION_POINTER_UP = 47 new MotionEventActionMatcher(MotionEvent.ACTION_POINTER_UP); 48 public static final Matcher<MotionEvent> IS_ACTION_CANCEL = [all …]
|
/cts/tests/input/src/android/input/cts/ |
D | InputShellCommandTest.kt | 18 import android.view.MotionEvent 66 assertTapToolType(MotionEvent.TOOL_TYPE_FINGER) in testDefaultToolType() 77 assertTapToolType(MotionEvent.TOOL_TYPE_FINGER) in testToolType() 80 assertTapToolType(MotionEvent.TOOL_TYPE_FINGER) in testToolType() 83 assertTapToolType(MotionEvent.TOOL_TYPE_FINGER) in testToolType() 86 assertTapToolType(MotionEvent.TOOL_TYPE_STYLUS) in testToolType() 89 assertTapToolType(MotionEvent.TOOL_TYPE_MOUSE) in testToolType() 92 assertTapToolType(MotionEvent.TOOL_TYPE_MOUSE) in testToolType() 95 assertTapToolType(MotionEvent.TOOL_TYPE_UNKNOWN) in testToolType() 98 private fun getMotionEvent(): MotionEvent { in getMotionEvent() [all …]
|
D | CaptureEventActivity.kt | 22 import android.view.MotionEvent 29 override fun dispatchGenericMotionEvent(ev: MotionEvent?): Boolean { in dispatchGenericMotionEvent() 30 mEvents.add(MotionEvent.obtain(ev)) in dispatchGenericMotionEvent() 34 override fun dispatchTouchEvent(ev: MotionEvent?): Boolean { in dispatchTouchEvent() 35 mEvents.add(MotionEvent.obtain(ev)) in dispatchTouchEvent() 44 override fun dispatchTrackballEvent(ev: MotionEvent?): Boolean { in dispatchTrackballEvent() 45 mEvents.add(MotionEvent.obtain(ev)) in dispatchTrackballEvent()
|
/cts/tests/tests/hardware/src/android/hardware/input/cts/tests/ |
D | InputTestCase.java | 31 import android.view.MotionEvent; 134 private void assertReceivedMotionEvent(@NonNull MotionEvent expectedEvent) { in assertReceivedMotionEvent() 135 MotionEvent event = waitForMotion(); in assertReceivedMotionEvent() 156 if (event.getActionMasked() == MotionEvent.ACTION_BUTTON_PRESS in assertReceivedMotionEvent() 157 || event.getActionMasked() == MotionEvent.ACTION_BUTTON_RELEASE) { in assertReceivedMotionEvent() 175 void assertAxis(String testCase, MotionEvent expectedEvent, MotionEvent actualEvent) { in assertAxis() 177 for (int axis = MotionEvent.AXIS_X; axis <= MotionEvent.AXIS_GENERIC_16; axis++) { in assertAxis() 179 + " (" + MotionEvent.axisToString(axis) + ")", in assertAxis() 245 if (event instanceof MotionEvent) { in verifyEvents() 246 assertReceivedMotionEvent((MotionEvent) event); in verifyEvents() [all …]
|
D | GameviceGv186Test.java | 22 import android.view.MotionEvent; 40 void assertAxis(String testCase, MotionEvent expectedEvent, MotionEvent actualEvent) { in assertAxis() 41 for (int axis = MotionEvent.AXIS_X; axis <= MotionEvent.AXIS_GENERIC_16; axis++) { in assertAxis() 44 if (axis == MotionEvent.AXIS_GENERIC_1 || axis == MotionEvent.AXIS_GENERIC_2) { in assertAxis() 47 assertEquals(testCase + " (" + MotionEvent.axisToString(axis) + ")", in assertAxis()
|
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/ |
D | CtsMouseUtil.java | 29 import android.view.MotionEvent; 47 mockListener.onHover(v, MotionEvent.obtain(event)); in installHoverListener() 57 public static MotionEvent obtainMouseEvent(int action, View anchor, int offsetX, int offsetY) { in obtainMouseEvent() 63 MotionEvent event = MotionEvent.obtain(eventTime, eventTime, action, x, y, 0); in obtainMouseEvent() 91 MotionEvent event = MotionEvent.obtain(downTime, downTime, MotionEvent.ACTION_HOVER_MOVE, in injectHoverEvent() 98 public static class ActionMatcher implements ArgumentMatcher<MotionEvent> { 106 public boolean matches(MotionEvent actual) { in matches() 112 return "action=" + MotionEvent.actionToString(mAction); in toString() 127 public boolean matches(MotionEvent actual) { in matches() 150 argThat(new ActionMatcher(MotionEvent.ACTION_HOVER_EXIT))); in verifyEnterMoveExit() [all …]
|
/cts/tests/tests/text/src/android/text/method/cts/ |
D | ScrollingMovementMethodTest.java | 37 import android.view.MotionEvent; 129 MotionEvent.obtain(now, now, MotionEvent.ACTION_DOWN, 0, 0, 0)); in testOnTouchEventHorizontalMotion() 139 MotionEvent.obtain(now, now, MotionEvent.ACTION_MOVE, tinyDist, 0, 0)); in testOnTouchEventHorizontalMotion() 148 MotionEvent.obtain(now, now, MotionEvent.ACTION_UP, tinyDist, 0, 0)); in testOnTouchEventHorizontalMotion() 156 MotionEvent.obtain(now, now, MotionEvent.ACTION_DOWN, 0, 0, 0)); in testOnTouchEventHorizontalMotion() 166 MotionEvent.obtain(now, now, MotionEvent.ACTION_MOVE, distFar, 0, 0)); in testOnTouchEventHorizontalMotion() 178 MotionEvent.obtain(now, now, MotionEvent.ACTION_MOVE, distTooFar, 0, 0)); in testOnTouchEventHorizontalMotion() 189 MotionEvent.obtain(now, now, MotionEvent.ACTION_MOVE, 0, 0, 0)); in testOnTouchEventHorizontalMotion() 199 MotionEvent.obtain(now, now, MotionEvent.ACTION_UP, 0, 0, 0)); in testOnTouchEventHorizontalMotion() 222 mResult = method.onTouchEvent(mTextView, mSpannable, MotionEvent.obtain(now, now, [all …]
|
/cts/tests/tests/security/src/android/security/cts/ |
D | SlipperyEnterBottomActivity.kt | 20 import android.view.MotionEvent 29 private val eventQueue: Queue<MotionEvent> = LinkedBlockingQueue() 31 override fun onTouchEvent(motionEvent: MotionEvent): Boolean { in onTouchEvent() 32 eventQueue.add(MotionEvent.obtain(motionEvent)) in onTouchEvent() 36 fun getEvent(): MotionEvent? { in getEvent()
|