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

Commit 6c4e7e51 authored by Josh Thielen's avatar Josh Thielen Committed by Android (Google) Code Review
Browse files

Merge "Fix touch reset when enable state is unchanged"

parents 603aa6ff 6093f102
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1159,6 +1159,8 @@ void NativeInputManager::setTouchpadRightClickZoneEnabled(bool enabled) {
}

void NativeInputManager::setInputDeviceEnabled(uint32_t deviceId, bool enabled) {
    bool refresh = false;

    { // acquire lock
        std::scoped_lock _l(mLock);

@@ -1166,15 +1168,19 @@ void NativeInputManager::setInputDeviceEnabled(uint32_t deviceId, bool enabled)
        bool currentlyEnabled = it == mLocked.disabledInputDevices.end();
        if (!enabled && currentlyEnabled) {
            mLocked.disabledInputDevices.insert(deviceId);
            refresh = true;
        }
        if (enabled && !currentlyEnabled) {
            mLocked.disabledInputDevices.erase(deviceId);
            refresh = true;
        }
    } // release lock

    if (refresh) {
        mInputManager->getReader().requestRefreshConfiguration(
                InputReaderConfiguration::Change::ENABLED_STATE);
    }
}

void NativeInputManager::setShowTouches(bool enabled) {
    { // acquire lock