diff options
| author | 2021-03-10 22:45:12 -0800 | |
|---|---|---|
| committer | 2021-04-01 22:58:35 -0700 | |
| commit | e2b1e5c71765d5b8bc303bbfa6741c0c96e95d44 (patch) | |
| tree | fdb0dd18d06524d550f080a9fe2ba5531c29214c /include/input/InputDevice.h | |
| parent | 6368475d4373ef9427b452f9704361d6c7e04fc7 (diff) | |
Introduce Device Controller to InputReader
Introduce Device Controller to manage non-evdev devices associated with
the input device kernel interface. These devices doesn't interact with
inputflinger with input events which requires a mapper to process the
raw event with assoicated input sources.
Bug: 180342233
Test: atest inputflinger_tests
Change-Id: Ib492bb3de889db180c05367bb6a7e7a2e0d78ce7
Diffstat (limited to 'include/input/InputDevice.h')
| -rw-r--r-- | include/input/InputDevice.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h index 2deb99d154..712adfa57b 100644 --- a/include/input/InputDevice.h +++ b/include/input/InputDevice.h @@ -177,6 +177,14 @@ struct InputDeviceLightInfo { int32_t ordinal; }; +struct InputDeviceBatteryInfo { + explicit InputDeviceBatteryInfo(std::string name, int32_t id) : name(name), id(id) {} + // Name string of the battery. + std::string name; + // Battery id + int32_t id; +}; + /* * Describes the characteristics and capabilities of an input device. */ @@ -219,6 +227,7 @@ public: float min, float max, float flat, float fuzz, float resolution); void addMotionRange(const MotionRange& range); void addSensorInfo(const InputDeviceSensorInfo& info); + void addBatteryInfo(const InputDeviceBatteryInfo& info); void addLightInfo(const InputDeviceLightInfo& info); inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; } @@ -276,6 +285,8 @@ private: std::unordered_map<InputDeviceSensorType, InputDeviceSensorInfo> mSensors; /* Map from light ID to light info */ std::unordered_map<int32_t, InputDeviceLightInfo> mLights; + /* Map from battery ID to battery info */ + std::unordered_map<int32_t, InputDeviceBatteryInfo> mBatteries; }; /* Types of input device configuration files. */ |