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

Commit 86f5df6f authored by Harry Cutts's avatar Harry Cutts
Browse files

Copy InputDeviceIdentifier instead of taking a reference

This line appears to be causing hwasan failures in the lab (see bug).
While a const& should extend the lifetime of the thing it's referring
to, that doesn't seem to be happening in this case, possibly because
getDeviceIdentifier isn't a simple getter. InputDeviceIdentifier isn't a
particularly large struct, and we intend to replace this code with an
IDC property anyway, so just take a copy of it.

Bug: 266534706, 251196347
Test: atest inputflinger_tests
Test: connect Sony gamepads, check old stack is used
Test: connect Apple Magic Trackpad 2, check new stack is used
Change-Id: I98f09f8226bc5e42082b07f9795eccc6de890879
parent 156c9feb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ void InputDevice::addEventHubDevice(int32_t eventHubId, bool populateMappers) {
            sysprop::InputProperties::enable_touchpad_gestures_library().value_or(false);
    // 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.
    const InputDeviceIdentifier& identifier = contextPtr->getDeviceIdentifier();
    const InputDeviceIdentifier identifier = contextPtr->getDeviceIdentifier();
    const bool isSonyGamepadTouchpad = identifier.vendor == 0x054c &&
            (identifier.product == 0x05c4 || identifier.product == 0x09cc ||
             identifier.product == 0x0ce6);