Loading include/input/Input.h +6 −0 Original line number Diff line number Diff line Loading @@ -177,7 +177,9 @@ struct AInputDevice { namespace android { #ifdef __linux__ class Parcel; #endif const char* inputEventTypeToString(int32_t type); Loading Loading @@ -344,8 +346,10 @@ struct PointerCoords { return getAxisValue(AMOTION_EVENT_AXIS_Y); } #ifdef __linux__ status_t readFromParcel(Parcel* parcel); status_t writeToParcel(Parcel* parcel) const; #endif bool operator==(const PointerCoords& other) const; inline bool operator!=(const PointerCoords& other) const { Loading Loading @@ -704,8 +708,10 @@ public: // Matrix is in row-major form and compatible with SkMatrix. void transform(const std::array<float, 9>& matrix); #ifdef __linux__ status_t readFromParcel(Parcel* parcel); status_t writeToParcel(Parcel* parcel) const; #endif static bool isTouchEvent(uint32_t source, int32_t action); inline bool isTouchEvent() const { Loading include/input/KeyCharacterMap.h +4 −0 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <stdint.h> #ifdef __linux__ #include <binder/IBinder.h> #endif #include <android-base/result.h> #include <input/Input.h> Loading Loading @@ -132,11 +134,13 @@ public: void tryRemapKey(int32_t scanCode, int32_t metaState, int32_t* outKeyCode, int32_t* outMetaState) const; #ifdef __linux__ /* Reads a key map from a parcel. */ static std::shared_ptr<KeyCharacterMap> readFromParcel(Parcel* parcel); /* Writes a key map to a parcel. */ void writeToParcel(Parcel* parcel) const; #endif KeyCharacterMap(const KeyCharacterMap& other); Loading libs/input/Input.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ #include <input/InputDevice.h> #include <input/InputEventLabels.h> #ifdef __linux__ #include <binder/Parcel.h> #endif #ifdef __ANDROID__ #include <sys/random.h> #endif Loading Loading @@ -254,6 +256,7 @@ void PointerCoords::applyOffset(float xOffset, float yOffset) { setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset); } #ifdef __linux__ status_t PointerCoords::readFromParcel(Parcel* parcel) { bits = parcel->readInt64(); Loading @@ -277,6 +280,7 @@ status_t PointerCoords::writeToParcel(Parcel* parcel) const { } return OK; } #endif void PointerCoords::tooManyAxes(int axis) { ALOGW("Could not set value for axis %d because the PointerCoords structure is full and " Loading Loading @@ -538,6 +542,7 @@ void MotionEvent::transform(const std::array<float, 9>& matrix) { } } #ifdef __linux__ static status_t readFromParcel(ui::Transform& transform, const Parcel& parcel) { float dsdx, dtdx, tx, dtdy, dsdy, ty; status_t status = parcel.readFloat(&dsdx); Loading Loading @@ -674,6 +679,7 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const { } return OK; } #endif bool MotionEvent::isTouchEvent(uint32_t source, int32_t action) { if (source & AINPUT_SOURCE_CLASS_POINTER) { Loading libs/input/KeyCharacterMap.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <stdlib.h> #include <string.h> #ifdef __linux__ #include <binder/Parcel.h> #endif #include <android/keycodes.h> #include <attestation/HmacKeyManager.h> #include <input/InputEventLabels.h> Loading Loading @@ -585,6 +587,7 @@ void KeyCharacterMap::addLockedMetaKey(Vector<KeyEvent>& outEvents, } } #ifdef __linux__ std::shared_ptr<KeyCharacterMap> KeyCharacterMap::readFromParcel(Parcel* parcel) { if (parcel == nullptr) { ALOGE("%s: Null parcel", __func__); Loading Loading @@ -670,7 +673,7 @@ void KeyCharacterMap::writeToParcel(Parcel* parcel) const { parcel->writeInt32(0); } } #endif // __linux__ // --- KeyCharacterMap::Key --- Loading Loading
include/input/Input.h +6 −0 Original line number Diff line number Diff line Loading @@ -177,7 +177,9 @@ struct AInputDevice { namespace android { #ifdef __linux__ class Parcel; #endif const char* inputEventTypeToString(int32_t type); Loading Loading @@ -344,8 +346,10 @@ struct PointerCoords { return getAxisValue(AMOTION_EVENT_AXIS_Y); } #ifdef __linux__ status_t readFromParcel(Parcel* parcel); status_t writeToParcel(Parcel* parcel) const; #endif bool operator==(const PointerCoords& other) const; inline bool operator!=(const PointerCoords& other) const { Loading Loading @@ -704,8 +708,10 @@ public: // Matrix is in row-major form and compatible with SkMatrix. void transform(const std::array<float, 9>& matrix); #ifdef __linux__ status_t readFromParcel(Parcel* parcel); status_t writeToParcel(Parcel* parcel) const; #endif static bool isTouchEvent(uint32_t source, int32_t action); inline bool isTouchEvent() const { Loading
include/input/KeyCharacterMap.h +4 −0 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <stdint.h> #ifdef __linux__ #include <binder/IBinder.h> #endif #include <android-base/result.h> #include <input/Input.h> Loading Loading @@ -132,11 +134,13 @@ public: void tryRemapKey(int32_t scanCode, int32_t metaState, int32_t* outKeyCode, int32_t* outMetaState) const; #ifdef __linux__ /* Reads a key map from a parcel. */ static std::shared_ptr<KeyCharacterMap> readFromParcel(Parcel* parcel); /* Writes a key map to a parcel. */ void writeToParcel(Parcel* parcel) const; #endif KeyCharacterMap(const KeyCharacterMap& other); Loading
libs/input/Input.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ #include <input/InputDevice.h> #include <input/InputEventLabels.h> #ifdef __linux__ #include <binder/Parcel.h> #endif #ifdef __ANDROID__ #include <sys/random.h> #endif Loading Loading @@ -254,6 +256,7 @@ void PointerCoords::applyOffset(float xOffset, float yOffset) { setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset); } #ifdef __linux__ status_t PointerCoords::readFromParcel(Parcel* parcel) { bits = parcel->readInt64(); Loading @@ -277,6 +280,7 @@ status_t PointerCoords::writeToParcel(Parcel* parcel) const { } return OK; } #endif void PointerCoords::tooManyAxes(int axis) { ALOGW("Could not set value for axis %d because the PointerCoords structure is full and " Loading Loading @@ -538,6 +542,7 @@ void MotionEvent::transform(const std::array<float, 9>& matrix) { } } #ifdef __linux__ static status_t readFromParcel(ui::Transform& transform, const Parcel& parcel) { float dsdx, dtdx, tx, dtdy, dsdy, ty; status_t status = parcel.readFloat(&dsdx); Loading Loading @@ -674,6 +679,7 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const { } return OK; } #endif bool MotionEvent::isTouchEvent(uint32_t source, int32_t action) { if (source & AINPUT_SOURCE_CLASS_POINTER) { Loading
libs/input/KeyCharacterMap.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ #include <stdlib.h> #include <string.h> #ifdef __linux__ #include <binder/Parcel.h> #endif #include <android/keycodes.h> #include <attestation/HmacKeyManager.h> #include <input/InputEventLabels.h> Loading Loading @@ -585,6 +587,7 @@ void KeyCharacterMap::addLockedMetaKey(Vector<KeyEvent>& outEvents, } } #ifdef __linux__ std::shared_ptr<KeyCharacterMap> KeyCharacterMap::readFromParcel(Parcel* parcel) { if (parcel == nullptr) { ALOGE("%s: Null parcel", __func__); Loading Loading @@ -670,7 +673,7 @@ void KeyCharacterMap::writeToParcel(Parcel* parcel) const { parcel->writeInt32(0); } } #endif // __linux__ // --- KeyCharacterMap::Key --- Loading