Plumb through display orientation separate from transform
This is exclusively used for getRaw compatibility. The input
transform can include window rotation and also, apparently,
nested view rotations as it the events get mutated by ui-toolkit.
Bug: 187686656
Test: cd frameworks/native/services/inputflinger && atest
Change-Id: I2fd7a2b2acbe422d962d0646d41c60eb48160620
diff --git a/include/input/Input.h b/include/input/Input.h
index d88dcfe..cd110e8 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -577,6 +577,8 @@
void setCursorPosition(float x, float y);
+ uint32_t getDisplayOrientation() const { return mDisplayOrientation; }
+
int2 getDisplaySize() const { return {mDisplayWidth, mDisplayHeight}; }
static inline bool isValidCursorPosition(float x, float y) { return !isnan(x) && !isnan(y); }
@@ -753,8 +755,8 @@
int32_t flags, int32_t edgeFlags, int32_t metaState, int32_t buttonState,
MotionClassification classification, const ui::Transform& transform,
float xPrecision, float yPrecision, float rawXCursorPosition,
- float rawYCursorPosition, int32_t displayWidth, int32_t displayHeight,
- nsecs_t downTime, nsecs_t eventTime, size_t pointerCount,
+ float rawYCursorPosition, uint32_t displayOrientation, int32_t displayWidth,
+ int32_t displayHeight, nsecs_t downTime, nsecs_t eventTime, size_t pointerCount,
const PointerProperties* pointerProperties, const PointerCoords* pointerCoords);
void copyFrom(const MotionEvent* other, bool keepHistory);
@@ -812,6 +814,7 @@
float mYPrecision;
float mRawXCursorPosition;
float mRawYCursorPosition;
+ uint32_t mDisplayOrientation;
int32_t mDisplayWidth;
int32_t mDisplayHeight;
nsecs_t mDownTime;