Create Native getTouchpadHardwareProperties()
Create Native method to get the hardware properties of touchpad and
connected it to InputManagerService.java using JNI
Bug: 286551975
Test: Verified that the data flow works correctly and the method references are valid.
Flag: com.android.hardware.input.touchpad_visualizer
Change-Id: Ic6c32eabd3078ff2b50e3b3bb430abadd9dd752c
diff --git a/services/inputflinger/reader/InputDevice.cpp b/services/inputflinger/reader/InputDevice.cpp
index 2daf195..70f024e 100644
--- a/services/inputflinger/reader/InputDevice.cpp
+++ b/services/inputflinger/reader/InputDevice.cpp
@@ -725,6 +725,15 @@
return count;
}
+std::optional<HardwareProperties> InputDevice::getTouchpadHardwareProperties() {
+ std::optional<HardwareProperties> result = first_in_mappers<HardwareProperties>(
+ [](InputMapper& mapper) -> std::optional<HardwareProperties> {
+ return mapper.getTouchpadHardwareProperties();
+ });
+
+ return result;
+}
+
void InputDevice::updateLedState(bool reset) {
for_each_mapper([reset](InputMapper& mapper) { mapper.updateLedState(reset); });
}