去除休眠

  1. frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    1
    <integer name="def_screen_off_timeout">60000</integer> 
    60000ms,修改为-1。-1代表0xffffffff,永远不要休眠
    或者修改为2147483647 Java中Integer.MAX_VALUE
  2. frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java
    1
    2
    loadIntegerSetting(stmt,Settings.System.SCREEN_OFF_TIMEOUT,
    R.integer.def_screen_off_timeout);

去除锁屏

  1. frameworks/base/core/res/res/values/config.xml
    1
    2
    <bool name="config_dreamsSupported">false</bool>
    <bool name="config_dreamsEnabledByDefault">false</bool>
  2. frameworks/base/packages/SettingsProvider/res/values/defaults.xml
    1
    <bool name="def_lockscreen_disabled">true</bool>
  3. frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
    1
    2
    3
    public void goToSleep(long eventTime, int reason, int flags) {

    if (true){ return; }