From 931fd6dee7891e94650353c09956ccf24b4dfff3 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Wed, 10 Jul 2013 18:05:15 -0700 Subject: [PATCH] Add input device property for buttons under touchpads Bug: 8990644 Change-Id: I6df5fb9e11199173d62523928082db428af55394 --- include/input/InputDevice.h | 4 ++++ libs/input/InputDevice.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h index 4672ad431..d8256c191 100644 --- a/include/input/InputDevice.h +++ b/include/input/InputDevice.h @@ -101,6 +101,9 @@ public: inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; } inline bool hasVibrator() const { return mHasVibrator; } + inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; } + inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; } + inline const Vector& getMotionRanges() const { return mMotionRanges; } @@ -115,6 +118,7 @@ private: int32_t mKeyboardType; sp mKeyCharacterMap; bool mHasVibrator; + bool mHasButtonUnderPad; Vector mMotionRanges; }; diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp index 77fa49dca..54703d4fc 100644 --- a/libs/input/InputDevice.cpp +++ b/libs/input/InputDevice.cpp @@ -136,6 +136,7 @@ InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) : mKeyboardType(other.mKeyboardType), mKeyCharacterMap(other.mKeyCharacterMap), mHasVibrator(other.mHasVibrator), + mHasButtonUnderPad(other.mHasButtonUnderPad), mMotionRanges(other.mMotionRanges) { } @@ -152,6 +153,7 @@ void InputDeviceInfo::initialize(int32_t id, int32_t generation, mSources = 0; mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE; mHasVibrator = false; + mHasButtonUnderPad = false; mMotionRanges.clear(); }