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

Commit a278f86e authored by Abdelrahman Awadalla's avatar Abdelrahman Awadalla Committed by Android (Google) Code Review
Browse files

Merge "Add InputReaderConfiguration option for touchpad visualization" into main

parents fe520ba6 61d0da32
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -227,6 +227,9 @@ struct InputReaderConfiguration {
    // True to enable tap dragging on touchpads.
    bool touchpadTapDraggingEnabled;

    // True if hardware state update notifications should be sent to the policy.
    bool shouldNotifyTouchpadHardwareState;

    // True to enable a zone on the right-hand side of touchpads where clicks will be turned into
    // context (a.k.a. "right") clicks.
    bool touchpadRightClickZoneEnabled;
@@ -268,6 +271,7 @@ struct InputReaderConfiguration {
            touchpadNaturalScrollingEnabled(true),
            touchpadTapToClickEnabled(true),
            touchpadTapDraggingEnabled(false),
            shouldNotifyTouchpadHardwareState(false),
            touchpadRightClickZoneEnabled(false),
            stylusButtonMotionEventsEnabled(true),
            stylusPointerIconEnabled(false) {}
+6 −0
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ std::list<NotifyArgs> TouchpadInputMapper::reconfigure(nsecs_t when,
                .setBoolValues({config.touchpadTapDraggingEnabled});
        mPropertyProvider.getProperty("Button Right Click Zone Enable")
                .setBoolValues({config.touchpadRightClickZoneEnabled});
        mTouchpadHardwareStateNotificationsEnabled = config.shouldNotifyTouchpadHardwareState;
    }
    std::list<NotifyArgs> out;
    if ((!changes.any() && config.pointerCaptureRequest.isEnable()) ||
@@ -421,6 +422,11 @@ std::list<NotifyArgs> TouchpadInputMapper::process(const RawEvent& rawEvent) {
    }
    std::optional<SelfContainedHardwareState> state = mStateConverter.processRawEvent(rawEvent);
    if (state) {
        if (mTouchpadHardwareStateNotificationsEnabled) {
            // TODO(b/286551975): Notify policy of the touchpad hardware state.
            LOG(DEBUG) << "Notify touchpad hardware state here!";
        }

        updatePalmDetectionMetrics();
        return sendHardwareState(rawEvent.when, rawEvent.readTime, *state);
    } else {
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ private:
    std::optional<ui::LogicalDisplayId> mDisplayId;

    nsecs_t mGestureStartTime{0};

    // True if hardware state update notifications is available for usage based on its feature flag
    // and settings value.
    bool mTouchpadHardwareStateNotificationsEnabled = false;
};

} // namespace android