Loading include/input/InputDevice.h +4 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,9 @@ public: inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; } inline bool hasVibrator() const { return mHasVibrator; } inline void setHasBattery(bool hasBattery) { mHasBattery = hasBattery; } inline bool hasBattery() const { return mHasBattery; } inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; } inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; } Loading @@ -239,6 +242,7 @@ private: int32_t mKeyboardType; std::shared_ptr<KeyCharacterMap> mKeyCharacterMap; bool mHasVibrator; bool mHasBattery; bool mHasButtonUnderPad; bool mHasSensor; Loading libs/input/InputDevice.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) mKeyboardType(other.mKeyboardType), mKeyCharacterMap(other.mKeyCharacterMap), mHasVibrator(other.mHasVibrator), mHasBattery(other.mHasBattery), mHasButtonUnderPad(other.mHasButtonUnderPad), mHasSensor(other.mHasSensor), mMotionRanges(other.mMotionRanges), Loading @@ -187,6 +188,7 @@ void InputDeviceInfo::initialize(int32_t id, int32_t generation, int32_t control mSources = 0; mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE; mHasVibrator = false; mHasBattery = false; mHasButtonUnderPad = false; mHasSensor = false; mMotionRanges.clear(); Loading libs/input/android/os/IInputConstants.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -28,4 +28,7 @@ interface IInputConstants * to identify apps that are using this flag. */ const long BLOCK_FLAG_SLIPPERY = 157929241; // Indicate invalid battery capacity const int INVALID_BATTERY_CAPACITY = -1; } services/inputflinger/include/InputReaderBase.h +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ public: virtual bool isVibrating(int32_t deviceId) = 0; virtual std::vector<int32_t> getVibratorIds(int32_t deviceId) = 0; /* Get battery level of a particular input device. */ virtual std::optional<int32_t> getBatteryCapacity(int32_t deviceId) = 0; /* Get battery status of a particular input device. */ virtual std::optional<int32_t> getBatteryStatus(int32_t deviceId) = 0; /* Return true if the device can send input events to the specified display. */ virtual bool canDispatchToDisplay(int32_t deviceId, int32_t displayId) = 0; Loading services/inputflinger/reader/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ filegroup { "mapper/accumulator/CursorScrollAccumulator.cpp", "mapper/accumulator/SingleTouchMotionAccumulator.cpp", "mapper/accumulator/TouchButtonAccumulator.cpp", "mapper/BatteryInputMapper.cpp", "mapper/CursorInputMapper.cpp", "mapper/ExternalStylusInputMapper.cpp", "mapper/InputMapper.cpp", Loading Loading @@ -60,7 +61,11 @@ cc_defaults { "libui", "libutils", ], static_libs: [ "libc++fs", ], header_libs: [ "libbatteryservice_headers", "libinputreader_headers", ], } Loading Loading
include/input/InputDevice.h +4 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,9 @@ public: inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; } inline bool hasVibrator() const { return mHasVibrator; } inline void setHasBattery(bool hasBattery) { mHasBattery = hasBattery; } inline bool hasBattery() const { return mHasBattery; } inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; } inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; } Loading @@ -239,6 +242,7 @@ private: int32_t mKeyboardType; std::shared_ptr<KeyCharacterMap> mKeyCharacterMap; bool mHasVibrator; bool mHasBattery; bool mHasButtonUnderPad; bool mHasSensor; Loading
libs/input/InputDevice.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) mKeyboardType(other.mKeyboardType), mKeyCharacterMap(other.mKeyCharacterMap), mHasVibrator(other.mHasVibrator), mHasBattery(other.mHasBattery), mHasButtonUnderPad(other.mHasButtonUnderPad), mHasSensor(other.mHasSensor), mMotionRanges(other.mMotionRanges), Loading @@ -187,6 +188,7 @@ void InputDeviceInfo::initialize(int32_t id, int32_t generation, int32_t control mSources = 0; mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE; mHasVibrator = false; mHasBattery = false; mHasButtonUnderPad = false; mHasSensor = false; mMotionRanges.clear(); Loading
libs/input/android/os/IInputConstants.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -28,4 +28,7 @@ interface IInputConstants * to identify apps that are using this flag. */ const long BLOCK_FLAG_SLIPPERY = 157929241; // Indicate invalid battery capacity const int INVALID_BATTERY_CAPACITY = -1; }
services/inputflinger/include/InputReaderBase.h +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ public: virtual bool isVibrating(int32_t deviceId) = 0; virtual std::vector<int32_t> getVibratorIds(int32_t deviceId) = 0; /* Get battery level of a particular input device. */ virtual std::optional<int32_t> getBatteryCapacity(int32_t deviceId) = 0; /* Get battery status of a particular input device. */ virtual std::optional<int32_t> getBatteryStatus(int32_t deviceId) = 0; /* Return true if the device can send input events to the specified display. */ virtual bool canDispatchToDisplay(int32_t deviceId, int32_t displayId) = 0; Loading
services/inputflinger/reader/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ filegroup { "mapper/accumulator/CursorScrollAccumulator.cpp", "mapper/accumulator/SingleTouchMotionAccumulator.cpp", "mapper/accumulator/TouchButtonAccumulator.cpp", "mapper/BatteryInputMapper.cpp", "mapper/CursorInputMapper.cpp", "mapper/ExternalStylusInputMapper.cpp", "mapper/InputMapper.cpp", Loading Loading @@ -60,7 +61,11 @@ cc_defaults { "libui", "libutils", ], static_libs: [ "libc++fs", ], header_libs: [ "libbatteryservice_headers", "libinputreader_headers", ], } Loading