+++ 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 值去修改
方法一只是修改了电源键的长按时间判断,方法二修改了全部