Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 034c4b84 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Use pointer source in MotionEventTest#testEventRotation

Only pointer sources have event rotation applied to them by MotionEvent.
We need to a pointer source like SOURCE_TOUCHSCREEN to ensure the event
is rotated as expected.

Bug: 179274888
Test: atest MotionEventTest

Change-Id: I610858c50bfbd42ecfeb326d162b17a3cb93f544
parent a3cd005f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ public class MotionEventTest {
    public void testEventRotation() {
        final MotionEvent event = MotionEvent.obtain(0 /* downTime */, 0 /* eventTime */,
                    ACTION_DOWN, 30 /* x */, 50 /* y */, 0 /* metaState */);
        event.setSource(InputDevice.SOURCE_TOUCHSCREEN);
        MotionEvent rot90 = MotionEvent.obtain(event);
        rot90.transform(MotionEvent.createRotateMatrix(/* 90 deg */1, 1000, 600));
        assertEquals(50, (int) rot90.getX());