Add new `TouchpadInputMapper` class
This will replace `MultiTouchInputMapper` and `SingleTouchInputMapper`
for touchpad devices, and will be the wrapper for the gestures library.
Bug: 251196347
Test: connect Apple Magic Trackpad 2 to device, check logs come out
Test: atest inputflinger_tests
Change-Id: Ia8ee1779a40c6c6f98373e114c040bf13b7f213d
diff --git a/services/inputflinger/reader/EventHub.cpp b/services/inputflinger/reader/EventHub.cpp
index 0aaef53..f2ea90c 100644
--- a/services/inputflinger/reader/EventHub.cpp
+++ b/services/inputflinger/reader/EventHub.cpp
@@ -2215,6 +2215,10 @@
// a touch screen.
if (device->keyBitmask.test(BTN_TOUCH) || !haveGamepadButtons) {
device->classes |= (InputDeviceClass::TOUCH | InputDeviceClass::TOUCH_MT);
+ if (device->propBitmask.test(INPUT_PROP_POINTER) &&
+ !device->keyBitmask.any(BTN_TOOL_PEN, BTN_TOOL_FINGER) && !haveStylusButtons) {
+ device->classes |= InputDeviceClass::TOUCHPAD;
+ }
}
// Is this an old style single-touch driver?
} else if (device->keyBitmask.test(BTN_TOUCH) && device->absBitmask.test(ABS_X) &&