Android 12对USB TP触摸唤醒进行了修改。

前言

无论使用何种型号的 USB TP,Android 12 系统在休眠时都能够通过触摸唤醒。

在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

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注