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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user