当前位置: 首页 > 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();

 

http://www.lryc.cn/news/175433.html

相关文章:

  • #define定义标识符详解
  • 开发者必备!如何将闲置iPad Pro打造为编程工具,使用VS Code编写代码
  • 【Java 基础篇】Java 模块化详解
  • 【2023面试题大全,都是常问面试题】
  • Bun 1.0 正式发布,爆火的前端运行时,速度遥遥领先!
  • getchar函数设置为非阻塞
  • 【超算作业调度系统--LSF】
  • L1-011 A-B分数 20
  • PHPword解析内容支撑
  • 回归预测 | MATLAB实现RUN-XGBoost龙格库塔优化极限梯度提升树多输入回归预测
  • LLM-TAP随笔——语言模型训练数据【深度学习】【PyTorch】【LLM】
  • Linux- open() lseek()
  • Halcon Tuple相关算子(一)
  • 基于图像形态学处理的路面裂缝检测算法matlab仿真
  • PY32F003F18之窗口看门狗
  • SpingBoot:整合Mybatis-plus+Druid+mysql
  • 计算机视觉与深度学习-经典网络解析-VGG-[北邮鲁鹏]
  • 入门级制作电子期刊的网站推荐
  • 软件测试内容整理
  • UniAccess Agent卸载
  • 【C++】C++11——构造、赋值使用条件和生成条件
  • 【LeetCode热题100】--56.合并区间
  • opencv dnn模块 示例(17) 目标检测 object_detection 之 yolo v5
  • 关于安卓SVGA浅尝(一)svgaplayer库的使用
  • 【LFU】一文让你弄清 Redis LFU 页面置换算法
  • Python爬虫实战:用简单四步爬取小红书图片
  • 行为型模式-解释器模式
  • Linux系统编程(五):信号
  • 学习路之工具--SecureCRT的下载、安装
  • 软件定义网络-OpenvSwitch