diff options
author | LuK1337 <priv.luk@gmail.com> | 2022-03-18 22:43:00 +0100 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-05-02 00:03:18 +0800 |
commit | 8bd964a91e09bd9ed187bc194fe87a956431d345 (patch) | |
tree | f6c6ec59a5a62b8a8ae56bed296215b562747337 | |
parent | 89a85a30a46268f508bf47a0f0ec35640b7780ec (diff) |
MotionEvent: Add backwards compatible initialize() function
After 0957669 changed MotionEvent::initialize() function signature,
libwfdnative.so compiled for Android 12 fails to load.
Change-Id: I8ad721adc0f00610836df62826d74d7da6764a39
-rw-r--r-- | include/input/Input.h | 11 | ||||
-rw-r--r-- | libs/input/Input.cpp | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/input/Input.h b/include/input/Input.h index 4adaa5b1c5..e0bc4442b0 100644 --- a/include/input/Input.h +++ b/include/input/Input.h @@ -759,6 +759,17 @@ public: int32_t displayHeight, nsecs_t downTime, nsecs_t eventTime, size_t pointerCount, const PointerProperties* pointerProperties, const PointerCoords* pointerCoords); +private: + void initialize(int32_t id, int32_t deviceId, uint32_t source, int32_t displayId, + std::array<uint8_t, 32> hmac, int32_t action, int32_t actionButton, + 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, + const PointerProperties* pointerProperties, const PointerCoords* pointerCoords); + +public: void copyFrom(const MotionEvent* other, bool keepHistory); void addSample( diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp index 5f440b77e2..fbb69fdbd5 100644 --- a/libs/input/Input.cpp +++ b/libs/input/Input.cpp @@ -455,6 +455,24 @@ void MotionEvent::initialize(int32_t id, int32_t deviceId, uint32_t source, int3 addSample(eventTime, pointerCoords); } +void MotionEvent::initialize(int32_t id, int32_t deviceId, uint32_t source, int32_t displayId, + std::array<uint8_t, 32> hmac, int32_t action, int32_t actionButton, + 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, + const PointerProperties* pointerProperties, + const PointerCoords* pointerCoords) { + uint32_t displayOrientation = ui::Transform::ROT_0; + MotionEvent::initialize(id, deviceId, source, displayId, hmac, action, actionButton, flags, + edgeFlags, metaState, buttonState, classification, transform, + xPrecision, yPrecision, rawXCursorPosition, rawYCursorPosition, + displayOrientation, displayWidth, displayHeight, downTime, eventTime, + pointerCount, pointerProperties, pointerCoords); +} + void MotionEvent::copyFrom(const MotionEvent* other, bool keepHistory) { InputEvent::initialize(other->mId, other->mDeviceId, other->mSource, other->mDisplayId, other->mHmac); |