diff options
| author | 2020-01-31 05:11:47 +0000 | |
|---|---|---|
| committer | 2020-01-31 05:11:47 +0000 | |
| commit | aa5a4f118245c595fbb82f2486105d1934c8f43a (patch) | |
| tree | 9961d001a53dd8b560c8631a51837c5c2ea67524 /libs/input/Input.cpp | |
| parent | a433f5d64ef36150e7a919bdc8b12f5789817257 (diff) | |
| parent | 3826d47fa79b505683c20317fa1b8dafb0c8bd39 (diff) | |
Merge "Use uint32_t for input source"
Diffstat (limited to 'libs/input/Input.cpp')
| -rw-r--r-- | libs/input/Input.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp index 975483bf04..85b0fd0ec7 100644 --- a/libs/input/Input.cpp +++ b/libs/input/Input.cpp @@ -57,7 +57,7 @@ const char* inputEventTypeToString(int32_t type) { return "UNKNOWN"; } -void InputEvent::initialize(int32_t deviceId, int32_t source, int32_t displayId, +void InputEvent::initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac) { mDeviceId = deviceId; mSource = source; @@ -82,7 +82,7 @@ int32_t KeyEvent::getKeyCodeFromLabel(const char* label) { return getKeyCodeByLabel(label); } -void KeyEvent::initialize(int32_t deviceId, int32_t source, int32_t displayId, +void KeyEvent::initialize(int32_t deviceId, uint32_t source, int32_t displayId, std::array<uint8_t, 32> hmac, int32_t action, int32_t flags, int32_t keyCode, int32_t scanCode, int32_t metaState, int32_t repeatCount, nsecs_t downTime, nsecs_t eventTime) { @@ -245,7 +245,7 @@ void PointerProperties::copyFrom(const PointerProperties& other) { // --- MotionEvent --- -void MotionEvent::initialize(int32_t deviceId, int32_t source, int32_t displayId, +void MotionEvent::initialize(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, float xScale, @@ -488,7 +488,7 @@ status_t MotionEvent::readFromParcel(Parcel* parcel) { } mDeviceId = parcel->readInt32(); - mSource = parcel->readInt32(); + mSource = parcel->readUint32(); mDisplayId = parcel->readInt32(); std::vector<uint8_t> hmac; status_t result = parcel->readByteVector(&hmac); @@ -549,7 +549,7 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const { parcel->writeInt32(sampleCount); parcel->writeInt32(mDeviceId); - parcel->writeInt32(mSource); + parcel->writeUint32(mSource); parcel->writeInt32(mDisplayId); std::vector<uint8_t> hmac(mHmac.begin(), mHmac.end()); parcel->writeByteVector(hmac); @@ -590,7 +590,7 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const { } #endif -bool MotionEvent::isTouchEvent(int32_t source, int32_t action) { +bool MotionEvent::isTouchEvent(uint32_t source, int32_t action) { if (source & AINPUT_SOURCE_CLASS_POINTER) { // Specifically excludes HOVER_MOVE and SCROLL. switch (action & AMOTION_EVENT_ACTION_MASK) { |