码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 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的能够触摸唤醒,只需按如下修改即可:

    1. Index: reader/mapper/TouchInputMapper.cpp
    2. ===================================================================
    3. --- reader/mapper/TouchInputMapper.cpp (revision 2066)
    4. +++ reader/mapper/TouchInputMapper.cpp (working copy)
    5. @@ -508,7 +508,7 @@
    6. // Initial downs on external touch devices should wake the device.
    7. // Normally we don't do this for internal touch screens to prevent them from waking
    8. // up in your pocket but you can enable it using the input device configuration.
    9. - mParameters.wake = getDeviceContext().isExternal();
    10. + mParameters.wake = true;
    11. getDeviceContext().getConfiguration().tryGetProperty(String8("touch.wake"), mParameters.wake);
    12. }

     

    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

     修改方法

    1. @@ -664,12 +664,12 @@
    2. return;
    3. }
    4. - if (!newViewport->isActive) {
    5. - ALOGI("Disabling %s (device %i) because the associated viewport is not active",
    6. - getDeviceName().c_str(), getDeviceId());
    7. - mDeviceMode = DeviceMode::DISABLED;
    8. - return;
    9. - }
    10. + // if (!newViewport->isActive) {
    11. + // ALOGI("Disabling %s (device %i) because the associated viewport is not active",
    12. + // getDeviceName().c_str(), getDeviceId());
    13. + // mDeviceMode = DeviceMode::DISABLED;
    14. + // return;
    15. + // }
    16. // Raw width and height in the natural orientation.
    17. int32_t rawWidth = mRawPointerAxes.getRawWidth();

     

  • 相关阅读:
    ubuntu18.04安装google浏览器
    【图像融合】基于matlab粒子群优化自适应多光谱图像融合【含Matlab源码 004期】
    英语语法汇总(13.虚拟语气)
    不平衡数据处理--学习笔记
    MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
    VPP二层接口,不是翻墙
    [每日两题系列]刷算法题咯~~
    基于51单片机的波形发生器proteus仿真数码管LCD12864显示
    git 如何删除某个提交之后的所有提交内容
    【python】使用python将多个视频合并、延长视频的时间
  • 原文地址:https://blog.csdn.net/xiaowang_lj/article/details/133082273
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号