plumb display orientation through motionevent for getRaw compatibility

Window rotations and ui-toolkit mutation mean we have to store
the display orientation separate from the transform for getRaw
compatibility

Bug: 187686656
Test: cd frameworks/native/services/inputflinger && atest
Change-Id: I02a037dbc4fa1645e446bc10f9e53c8d05884ddf
This commit is contained in:
Evan Rosky
2021-07-01 14:10:46 -07:00
parent 6798a14a59
commit 7890448e18
2 changed files with 4 additions and 3 deletions

View File

@@ -155,6 +155,7 @@ status_t NativeInputEventSender::sendMotionEvent(uint32_t seq, const MotionEvent
event->getYPrecision(),
event->getRawXCursorPosition(),
event->getRawYCursorPosition(),
event->getDisplayOrientation(),
event->getDisplaySize().x,
event->getDisplaySize().y, event->getDownTime(),
event->getHistoricalEventTime(i),

View File

@@ -397,9 +397,9 @@ static jlong android_view_MotionEvent_nativeInitialize(
flags, edgeFlags, metaState, buttonState,
static_cast<MotionClassification>(classification), transform, xPrecision,
yPrecision, AMOTION_EVENT_INVALID_CURSOR_POSITION,
AMOTION_EVENT_INVALID_CURSOR_POSITION, INVALID_DISPLAY_SIZE,
INVALID_DISPLAY_SIZE, downTimeNanos, eventTimeNanos, pointerCount,
pointerProperties, rawPointerCoords);
AMOTION_EVENT_INVALID_CURSOR_POSITION, ui::Transform::ROT_0,
INVALID_DISPLAY_SIZE, INVALID_DISPLAY_SIZE, downTimeNanos, eventTimeNanos,
pointerCount, pointerProperties, rawPointerCoords);
return reinterpret_cast<jlong>(event.release());
}