diff options
| author | 2024-11-15 16:09:19 +0000 | |
|---|---|---|
| committer | 2024-11-15 16:09:19 +0000 | |
| commit | 0dd9a4e7deefe62f12f9ad90c03d86782878237c (patch) | |
| tree | 90332b59d92ddf275836e29e8ff598b771df01b3 | |
| parent | 3f8b9574ce93f8f6b32ef32ee0014c92762318d7 (diff) | |
Input: Gate setKernelWakeEnabled with a flag
This flag was previously added but not used.
Bug: 372812925
Change-Id: If6ebb8b73b3dbe802d7fd3dac0ac689000102014
Test: Plug in USB mouse and power/wakeup is not changed without
explicitly setting this flag "enabled".
Flag: com.android.input.flags.set_input_device_kernel_wake
| -rw-r--r-- | services/inputflinger/reader/InputReader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/inputflinger/reader/InputReader.cpp b/services/inputflinger/reader/InputReader.cpp index a2b7e82154..ada6653f65 100644 --- a/services/inputflinger/reader/InputReader.cpp +++ b/services/inputflinger/reader/InputReader.cpp @@ -19,6 +19,7 @@ #include "InputReader.h" #include <android-base/stringprintf.h> +#include <com_android_input_flags.h> #include <errno.h> #include <input/Keyboard.h> #include <input/VirtualKeyMap.h> @@ -903,7 +904,9 @@ void InputReader::notifyMouseCursorFadedOnTyping() { bool InputReader::setKernelWakeEnabled(int32_t deviceId, bool enabled) { std::scoped_lock _l(mLock); - + if (!com::android::input::flags::set_input_device_kernel_wake()){ + return false; + } InputDevice* device = findInputDeviceLocked(deviceId); if (device) { return device->setKernelWakeEnabled(enabled); |