Skip to content

Commit 0dd9a4e

Browse files
author
Yanye Li
committed
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
1 parent 3f8b957 commit 0dd9a4e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

services/inputflinger/reader/InputReader.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "InputReader.h"
2020

2121
#include <android-base/stringprintf.h>
22+
#include <com_android_input_flags.h>
2223
#include <errno.h>
2324
#include <input/Keyboard.h>
2425
#include <input/VirtualKeyMap.h>
@@ -903,7 +904,9 @@ void InputReader::notifyMouseCursorFadedOnTyping() {
903904

904905
bool InputReader::setKernelWakeEnabled(int32_t deviceId, bool enabled) {
905906
std::scoped_lock _l(mLock);
906-
907+
if (!com::android::input::flags::set_input_device_kernel_wake()){
908+
return false;
909+
}
907910
InputDevice* device = findInputDeviceLocked(deviceId);
908911
if (device) {
909912
return device->setKernelWakeEnabled(enabled);

0 commit comments

Comments
 (0)