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

Commit 30e8c3f1 authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge changes from topic "gestures-lib-sysprop"

* changes:
  Use a sysprop to enable `TouchpadInputMapper`
  Add gestures library to whole_static_libs for input reader
parents b48a2606 89844625
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -116,6 +116,9 @@ cc_library_static {
        "libchrome-gestures_headers",
        "libinputreader_headers",
    ],
    whole_static_libs: [
        "libchrome-gestures",
    ],
}

cc_library_shared {
+10 −3
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@

#include <algorithm>

#if defined(__ANDROID__)
#include <android/sysprop/InputProperties.sysprop.h>
#endif
#include <ftl/flags.h>

#include "CursorInputMapper.h"
@@ -209,9 +212,13 @@ void InputDevice::addEventHubDevice(int32_t eventHubId, bool populateMappers) {
    }

    // Touchscreens and touchpad devices.
    // TODO(b/251196347): replace this with a proper flag.
    constexpr bool ENABLE_NEW_TOUCHPAD_STACK = false;
    if (ENABLE_NEW_TOUCHPAD_STACK && classes.test(InputDeviceClass::TOUCHPAD) &&
    static const bool ENABLE_TOUCHPAD_GESTURES_LIBRARY =
#if defined(__ANDROID__)
            sysprop::InputProperties::enable_touchpad_gestures_library().value_or(false);
#else
            false;
#endif
    if (ENABLE_TOUCHPAD_GESTURES_LIBRARY && classes.test(InputDeviceClass::TOUCHPAD) &&
        classes.test(InputDeviceClass::TOUCH_MT)) {
        mappers.push_back(std::make_unique<TouchpadInputMapper>(*contextPtr));
    } else if (classes.test(InputDeviceClass::TOUCH_MT)) {