Firefly开源社区

修改安卓长按的时间

92

积分

0

威望

0

贡献

技术小白

积分
92
发表于 2017-5-9 10:52:20     
+++ b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
安卓的长按关机对于长按的定义是500ms,可以有两种方法是修改他的时间
方法一:
@@ -1124,8 +1124,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 if (hasLongPressOnPowerBehavior()) {
                     Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS);
                     msg.setAsynchronous(true);
-                    mHandler.sendMessageDelayed(msg,
-                            ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
+                    mHandler.sendMessageDelayed(msg,1);
+                            //ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
                 }
方法2
frameworks/base/core/res/res/values/config.xml
中的config_globalActionsKeyTimeout 值去修改

方法一只是修改了电源键的长按时间判断,方法二修改了全部
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表