From 03ea035572c55fb3ab460acfebc703ca4ad6aa34 Mon Sep 17 00:00:00 2001 From: Kim Low Date: Fri, 6 Nov 2020 12:45:07 -0800 Subject: Added the ability to read external batteries Extended InputDevice and EventHub with capabilites to detect and read external battery status and capacity. This allows devices such as wireless gamepads to provide battery information to applications. Bug: 161633432 Test: atest InputDeviceBatteryTest Change-Id: I3c65166a1f0b055c5b85bad286afd5beb60bb303 Merged-In: I3c65166a1f0b055c5b85bad286afd5beb60bb303 --- include/input/InputDevice.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/input/InputDevice.h') diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h index 23692e92d4..2bd7bd2004 100644 --- a/include/input/InputDevice.h +++ b/include/input/InputDevice.h @@ -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; } @@ -239,6 +242,7 @@ private: int32_t mKeyboardType; std::shared_ptr mKeyCharacterMap; bool mHasVibrator; + bool mHasBattery; bool mHasButtonUnderPad; bool mHasSensor; -- cgit v1.2.3-59-g8ed1b