Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65e06694 authored by Harry Cutts's avatar Harry Cutts
Browse files

Enable new touchpad stack for Sony DualSense gamepad

Now that b/246587538 is fixed, the touchpad experience on the DualSense
is pretty good. There are still some issues on the DualShock 4, so keep
that on the old stack for now.

Bug: 251196347
Test: connect DualSense gamepad (USB & Bluetooth), check experience is
      smooth
Test: atest inputflinger_tests
Change-Id: I54f822a72161b464d8b5b2cf981200190bb7e709
parent 849d7822
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -210,14 +210,13 @@ void InputDevice::addEventHubDevice(int32_t eventHubId, bool populateMappers) {
    // Touchscreens and touchpad devices.
    static const bool ENABLE_TOUCHPAD_GESTURES_LIBRARY =
            sysprop::InputProperties::enable_touchpad_gestures_library().value_or(true);
    // TODO(b/246587538): Fix the new touchpad stack for Sony DualShock 4 (5c4, 9cc) and DualSense
    // (ce6) touchpads, or at least load this setting from the IDC file.
    // TODO(b/272518665): Fix the new touchpad stack for Sony DualShock 4 (5c4, 9cc) touchpads, or
    // at least load this setting from the IDC file.
    const InputDeviceIdentifier identifier = contextPtr->getDeviceIdentifier();
    const bool isSonyGamepadTouchpad = identifier.vendor == 0x054c &&
            (identifier.product == 0x05c4 || identifier.product == 0x09cc ||
             identifier.product == 0x0ce6);
    const bool isSonyDualShock4Touchpad = identifier.vendor == 0x054c &&
            (identifier.product == 0x05c4 || identifier.product == 0x09cc);
    if (ENABLE_TOUCHPAD_GESTURES_LIBRARY && classes.test(InputDeviceClass::TOUCHPAD) &&
        classes.test(InputDeviceClass::TOUCH_MT) && !isSonyGamepadTouchpad) {
        classes.test(InputDeviceClass::TOUCH_MT) && !isSonyDualShock4Touchpad) {
        mappers.push_back(std::make_unique<TouchpadInputMapper>(*contextPtr));
    } else if (classes.test(InputDeviceClass::TOUCH_MT)) {
        mappers.push_back(std::make_unique<MultiTouchInputMapper>(*contextPtr));