android13系统中修改usb tp触摸唤醒需要修改两个地方,一个是修改设备为可唤醒系统设备,一个是修改触摸设备在系统休眠之后,usb tp设备不被关闭掉。
1.修改设备为可唤醒系统设备:
--- a/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -509,7 +509,7 @@ void TouchInputMapper::configureParameters() {
// Initial downs on external touch devices should wake the device.
// Normally we don't do this for internal touch screens to prevent them from waking
// up in your pocket but you can enable it using the input device configuration.
- mParameters.wake = getDeviceContext().isExternal();
+ mParameters.wake = true;//getDeviceContext().isExternal();
getDeviceContext().getConfiguration().tryGetProperty(String8("touch.wake"), mParameters.wake);
2.修改触摸设备在系统休眠时不被关闭掉:
--- a/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -949,7 +949,7 @@ void TouchInputMapper::configureInputDevice(nsecs_t when, bool* outResetNeeded)
} else if (!newViewportOpt->isActive) {
ALOGI("Disabling %s (device %i) because the associated viewport is not active",
getDeviceName().c_str(), getDeviceId());
- mDeviceMode = DeviceMode::DISABLED;
+ //mDeviceMode = DeviceMode::DISABLED;
}
// Raw width and height in the natural orientation.