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

Commit da62cb20 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sync disabling of touchpad taps with hiding pointer" into main

parents 6cd2982b 849beb4c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@ void PointerChoreographer::fadeMouseCursorOnKeyPress(const android::NotifyKeyArg
    }
    auto it = mMousePointersByDisplay.find(targetDisplay);
    if (it != mMousePointersByDisplay.end()) {
        mPolicy.notifyMouseCursorFadedOnTyping();
        it->second->fade(PointerControllerInterface::Transition::GRADUAL);
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -397,6 +397,9 @@ public:
     * Returns ReservedInputDeviceId::INVALID_INPUT_DEVICE_ID if no device has been used since boot.
     */
    virtual DeviceId getLastUsedInputDeviceId() = 0;

    /* Notifies that mouse cursor faded due to typing. */
    virtual void notifyMouseCursorFadedOnTyping() = 0;
};

// --- TouchAffineTransformation ---
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ public:

    /* Returns true if any InputConnection is currently active. */
    virtual bool isInputMethodConnectionActive() = 0;

    /* Notifies that mouse cursor faded due to typing. */
    virtual void notifyMouseCursorFadedOnTyping() = 0;
};

} // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -907,6 +907,12 @@ DeviceId InputReader::getLastUsedInputDeviceId() {
    return mLastUsedDeviceId;
}

void InputReader::notifyMouseCursorFadedOnTyping() {
    std::scoped_lock _l(mLock);
    // disable touchpad taps when cursor has faded due to typing
    mPreventingTouchpadTaps = true;
}

void InputReader::dump(std::string& dump) {
    std::scoped_lock _l(mLock);

+3 −1
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ public:

    DeviceId getLastUsedInputDeviceId() override;

    void notifyMouseCursorFadedOnTyping() override;

protected:
    // These members are protected so they can be instrumented by test cases.
    virtual std::shared_ptr<InputDevice> createDeviceLocked(nsecs_t when, int32_t deviceId,
@@ -199,7 +201,7 @@ private:
    std::unordered_map<std::shared_ptr<InputDevice>, std::vector<int32_t> /*eventHubId*/>
            mDeviceToEventHubIdsMap GUARDED_BY(mLock);

    // true if tap-to-click on touchpad currently disabled
    // true if tap-to-click on touchpad is currently disabled
    bool mPreventingTouchpadTaps GUARDED_BY(mLock){false};

    // records timestamp of the last key press on the physical keyboard
Loading