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

Commit 7507d7bc authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Refactor requestRefreshConfiguration call

Currently, it appears that requestRefreshConfiguration can only ever be
called with a single configuration value. That means, we can probably
switch to using an enum class for the different configuration values,
and simplify some of the existing logic.

But it's not super obvious from code that only 1 bit is set in this
"changes" variable. Refactor it a little to make it more obvious.

Bug: 137212522
Test: none
Change-Id: I8d21e7ea05e0271229f72354888b722dfdaf3929
parent c513c703
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -826,18 +826,19 @@ void NativeInputManager::setInputWindows(JNIEnv* env, jobjectArray windowHandleO
        }
    }

    uint32_t changes = 0;
    bool pointerGesturesEnabledChanged = false;
    { // acquire lock
        AutoMutex _l(mLock);

        if (mLocked.pointerGesturesEnabled != newPointerGesturesEnabled) {
            mLocked.pointerGesturesEnabled = newPointerGesturesEnabled;
            changes |= InputReaderConfiguration::CHANGE_POINTER_GESTURE_ENABLEMENT;
            pointerGesturesEnabledChanged = true;
        }
    } // release lock

    if (changes) {
        mInputManager->getReader()->requestRefreshConfiguration(changes);
    if (pointerGesturesEnabledChanged) {
        mInputManager->getReader()->requestRefreshConfiguration(
                InputReaderConfiguration::CHANGE_POINTER_GESTURE_ENABLEMENT);
    }
}