当前位置: 首页 > news >正文

Android 12修改usb tp触摸唤醒

前言

 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的能够触摸唤醒,只需按如下修改即可:

Index: reader/mapper/TouchInputMapper.cpp
===================================================================
--- reader/mapper/TouchInputMapper.cpp  (revision 2066)
+++ reader/mapper/TouchInputMapper.cpp  (working copy)
@@ -508,7 +508,7 @@
     // 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().getConfiguration().tryGetProperty(String8("touch.wake"), mParameters.wake);
 }

 

09-20 21:45:13.715   664   818 I InputReader: Disabling eGalax Inc. eGalaxTouch P80H84 2331 v00_T1 k4.10.143 (device 3) because the associated viewport is not active

 修改方法

@@ -664,12 +664,12 @@
         return;
     }

-    if (!newViewport->isActive) {
-        ALOGI("Disabling %s (device %i) because the associated viewport is not active",
-              getDeviceName().c_str(), getDeviceId());
-        mDeviceMode = DeviceMode::DISABLED;
-        return;
-    }
+    // if (!newViewport->isActive) {
+        // ALOGI("Disabling %s (device %i) because the associated viewport is not active",
+              // getDeviceName().c_str(), getDeviceId());
+        // mDeviceMode = DeviceMode::DISABLED;
+        // return;
+    // }

     // Raw width and height in the natural orientation.
     int32_t rawWidth = mRawPointerAxes.getRawWidth();

 

相关文章:

  • 外包干了3个月,技术退步明显。。。。。
  • CHATGPT中国免费网页版有哪些-CHATGPT中文版网页
  • Vulnhub-driftingbules:5 靶机复现完整过程
  • 踩坑 | vue动态绑定img标签src属性的一系列报错
  • Python二级 每周练习题20
  • vue3学习笔记
  • C语言每日一题(9):跳水比赛猜名次
  • Java初始化大量数据到Neo4j中(一)
  • Openresty(二十二)ngx.balance和balance_by_lua终结篇
  • mySQL 安装
  • RocketMQ —消费者负载均衡
  • leetcode刷题笔记/代码随想录笔记——移除字符串中多余空格
  • 数组07-滑动窗口、HashMap
  • Leetcode.2571 将整数减少到零需要的最少操作数
  • Lnmp架构之mysql数据库实战2
  • 学习windows系统让python脚本在后台运行的方法
  • Java如何解决浮点数计算不精确问题
  • 从零开始之了解电机及其控制(10)空间矢量理论
  • 代理IP与Socks5代理:跨界电商之安全防护与智能数据引擎
  • Leetcode.2522 将字符串分割成值不超过 K 的子字符串
  • 大理州工业投资(集团)有限公司党委副书记、副总经理赵云接受审查调查
  • 2025“上海之夏”向全球邀约,首批城市定制活动集中亮相
  • 国常会:要持续稳定股市,持续推动房地产市场平稳健康发展
  • 习近平圆满结束对柬埔寨国事访问
  • 学习时报头版评论:历史的车轮不会倒退
  • 10亿美元拿下加纳金矿!“矿茅”紫金矿业黄金板块突围战再下一城