前言
Android 12系统休眠时,需要不管接什么型号usb tp都能够触摸唤醒。
Android12系统中,usb tp要能够触摸唤醒,需要在frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp中将mParameters.wake赋值为true,才能够在系统休眠的时候,触摸usb tp唤醒系统。(在TouchInputMapper.cpp中mParameters.wake的值是由getDeviceContext().isExternal();决定的,getDeviceContext().isExternal();是通过EventHub.cpp中的bool EventHub::Device::isExternalDeviceLocked()获得的。这个函数是通过读取对应tp idc文件中的device.internal属性来决定的。)我们现在要求所有的usb tp的能够触摸唤醒,只需按如下修改即可:
--- a/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/frameworks/native/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -509,6 +509,7 @@ void TouchInputMapper::configureParameters() {// Normally we don't do this for internal touch screens to prevent them from waking// up in your pocket but you c