TouchpadInputMapper: set reports_pressure hardware property
This will tell the Gestures library whether a touchpad reports pressure,
allowing it to disable pressure thresholds for touchpads that don't.
Bug: 292051746
Bug: 281907436
Test: with https://crrev.com/c/4794689 patched in libchrome-gestures,
try tapping to click on the Lenovo P12 Pro keyboard pack touchpad
Change-Id: I9d7fdb40cf20ee4f8261a6b0e5bf94c58017749e
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
index eca0f86..b826ab9 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
@@ -167,6 +167,10 @@
// Linux Kernel haptic touchpad support isn't merged yet, so for now assume that no touchpads
// are haptic.
props.is_haptic_pad = false;
+
+ RawAbsoluteAxisInfo absMtPressure;
+ context.getAbsoluteAxisInfo(ABS_MT_PRESSURE, &absMtPressure);
+ props.reports_pressure = absMtPressure.valid;
return props;
}