summaryrefslogtreecommitdiff
path: root/include/input/InputDevice.h
diff options
context:
space:
mode:
author Kim Low <kim-huei.low@sony.com> 2020-11-06 12:45:07 -0800
committer Chris Ye <lzye@google.com> 2021-02-02 01:17:14 +0000
commit03ea035572c55fb3ab460acfebc703ca4ad6aa34 (patch)
tree22e12f9082547cdb90312b9140f8eb2f1a25c2de /include/input/InputDevice.h
parent917c81d6fcb903078194be115451e3acb6f4ac22 (diff)
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
Diffstat (limited to 'include/input/InputDevice.h')
-rw-r--r--include/input/InputDevice.h4
1 files changed, 4 insertions, 0 deletions
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<KeyCharacterMap> mKeyCharacterMap;
bool mHasVibrator;
+ bool mHasBattery;
bool mHasButtonUnderPad;
bool mHasSensor;