android13修改默认usb tp支持触摸唤醒

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值