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

Commit e08bdbdc authored by Arpit Singh's avatar Arpit Singh
Browse files

InputMapper refactor: TouchpadInputMapper

Add a factory method for TouchpadInputMapper to be configured on
initilisation

Test: m checkinput && atest libinput_tests inputflinger_tests
Bug: 256009910
Change-Id: I1189eede635330b24f3f1175d2aa4b46775362b7
(cherry picked from commit 04e643ce)
parent 56adebc4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -501,7 +501,7 @@ std::vector<std::unique_ptr<InputMapper>> InputDevice::createMappers(
            (identifier.product == 0x05c4 || identifier.product == 0x09cc);
            (identifier.product == 0x05c4 || identifier.product == 0x09cc);
    if (ENABLE_TOUCHPAD_GESTURES_LIBRARY && classes.test(InputDeviceClass::TOUCHPAD) &&
    if (ENABLE_TOUCHPAD_GESTURES_LIBRARY && classes.test(InputDeviceClass::TOUCHPAD) &&
        classes.test(InputDeviceClass::TOUCH_MT) && !isSonyDualShock4Touchpad) {
        classes.test(InputDeviceClass::TOUCH_MT) && !isSonyDualShock4Touchpad) {
        mappers.push_back(std::make_unique<TouchpadInputMapper>(contextPtr, readerConfig));
        mappers.push_back(createInputMapper<TouchpadInputMapper>(contextPtr, readerConfig));
    } else if (classes.test(InputDeviceClass::TOUCH_MT)) {
    } else if (classes.test(InputDeviceClass::TOUCH_MT)) {
        mappers.push_back(createInputMapper<MultiTouchInputMapper>(contextPtr, readerConfig));
        mappers.push_back(createInputMapper<MultiTouchInputMapper>(contextPtr, readerConfig));
    } else if (classes.test(InputDeviceClass::TOUCH)) {
    } else if (classes.test(InputDeviceClass::TOUCH)) {
+6 −2
Original line number Original line Diff line number Diff line
@@ -40,8 +40,10 @@ namespace android {


class TouchpadInputMapper : public InputMapper {
class TouchpadInputMapper : public InputMapper {
public:
public:
    explicit TouchpadInputMapper(InputDeviceContext& deviceContext,
    template <class T, class... Args>
                                 const InputReaderConfiguration& readerConfig);
    friend std::unique_ptr<T> createInputMapper(InputDeviceContext& deviceContext,
                                                const InputReaderConfiguration& readerConfig,
                                                Args... args);
    ~TouchpadInputMapper();
    ~TouchpadInputMapper();


    uint32_t getSources() const override;
    uint32_t getSources() const override;
@@ -58,6 +60,8 @@ public:


private:
private:
    void resetGestureInterpreter(nsecs_t when);
    void resetGestureInterpreter(nsecs_t when);
    explicit TouchpadInputMapper(InputDeviceContext& deviceContext,
                                 const InputReaderConfiguration& readerConfig);
    [[nodiscard]] std::list<NotifyArgs> sendHardwareState(nsecs_t when, nsecs_t readTime,
    [[nodiscard]] std::list<NotifyArgs> sendHardwareState(nsecs_t when, nsecs_t readTime,
                                                          SelfContainedHardwareState schs);
                                                          SelfContainedHardwareState schs);
    [[nodiscard]] std::list<NotifyArgs> processGestures(nsecs_t when, nsecs_t readTime);
    [[nodiscard]] std::list<NotifyArgs> processGestures(nsecs_t when, nsecs_t readTime);