完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
测试平台
Platform: RK3399/RK3328 OS: Android7.1/8.1/9.0/10.0 现象 双击Power键会弹出Camer应用,由于机器默认不带摄像头,所以需要关闭这个快捷操作 分析解决 跟踪代码发现,双击power流程是从PhoneWindowManager传入GestureLauncherService中,然后在GestureLauncherService中进行处理的。 //frameworks/base/services/core/java/com/android/server/GestureLauncherService.java //frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java PhoneWindowManager.interceptPowerKeyDown() -> GestureLauncherService.interceptPowerKeyDown()-> GestureLauncherService.mCameraDoubleTapPowerEnabled- GestureLauncherService.isCameraDoubleTapPowerSettingEnabled() public static boolean isCameraDoubleTapPowerSettingEnabled(Context context, int userId) { return isCameraDoubleTapPowerEnabled(context.getResources()) && (Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0, userId) == 0); } public static boolean isCameraDoubleTapPowerEnabled(Resources resources) { return resources.getBoolean( com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled); } 由上可知道,控制双击Power 键功能的开关有两个: com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED 关闭其中一个即可实现需求 方案1: 关闭com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml index 9074a45..70a6254 100644 --- a/frameworks/base/core/res/res/values/config.xml +++ b/frameworks/base/core/res/res/values/config.xml @@ -3271,7 +3271,7 @@ - + 方案2: 关闭 Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml index 7b81d9a..91fcbec 100644 --- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml +++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -244,4 +244,7 @@ + + + diff --git a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 8c1825d..4cd7e16 100644 --- a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2432,6 +2432 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
1776 浏览 0 评论
2364 浏览 1 评论
2028 浏览 1 评论
3366 浏览 1 评论
4125 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-15 01:53 , Processed in 0.639924 second(s), Total 72, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号