summaryrefslogtreecommitdiff
path: root/libs/input/InputDevice.cpp
diff options
context:
space:
mode:
author Chris Ye <lzye@google.com> 2021-03-10 22:45:12 -0800
committer Chris Ye <lzye@google.com> 2021-04-01 22:58:35 -0700
commite2b1e5c71765d5b8bc303bbfa6741c0c96e95d44 (patch)
treefdb0dd18d06524d550f080a9fe2ba5531c29214c /libs/input/InputDevice.cpp
parent6368475d4373ef9427b452f9704361d6c7e04fc7 (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 'libs/input/InputDevice.cpp')
-rw-r--r--libs/input/InputDevice.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp
index ffcc1cd93a..31027b6476 100644
--- a/libs/input/InputDevice.cpp
+++ b/libs/input/InputDevice.cpp
@@ -231,6 +231,13 @@ void InputDeviceInfo::addSensorInfo(const InputDeviceSensorInfo& info) {
mSensors.insert_or_assign(info.type, info);
}
+void InputDeviceInfo::addBatteryInfo(const InputDeviceBatteryInfo& info) {
+ if (mBatteries.find(info.id) != mBatteries.end()) {
+ ALOGW("Battery id %d already exists, will be replaced by new battery added.", info.id);
+ }
+ mBatteries.insert_or_assign(info.id, info);
+}
+
void InputDeviceInfo::addLightInfo(const InputDeviceLightInfo& info) {
if (mLights.find(info.id) != mLights.end()) {
ALOGW("Light id %d already exists, will be replaced by new light added.", info.id);