android4.0去掉锁屏和休眠 Power键按钮

1、 去除休眠

frameworks/base/packages/SettingsProvider/res/values/defaults.xml

<integer name="def_screen_off_timeout">60000</integer>

60000ms,修改为-1。-1代表0xffffffff,等于永远不要休眠了

2、 去除锁屏

android/frameworks/base/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java

mExternallyEnabled 修改为false

这样就默认,不启动锁屏了。

三、Power键按钮

frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

3870行,注释掉这个case;

     case KeyEvent.KEYCODE_POWER: {
            /*
                result &= ~ACTION_PASS_TO_USER;
                if (down) {
                    if (isScreenOn && !mPowerKeyTriggered
                            && (event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
                        ..
                }
               */
                break;
}

你可能感兴趣的:(android4.0去掉锁屏和休眠 Power键按钮)