Android源码去掉开机自动锁屏

设置默认锁屏时间frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

private void loadSystemSettings(SQLiteDatabase db) {
    loadIntegerSetting(stmt,Settings.System.SCREEN_OFF_TIMEOUT,R.integer.def_screen_off_timeout);
}

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

-1

以毫秒为单位,设为-1即可,重新编译Setting Provider模块但是只是这样修改的话,启动后依旧会进入锁屏状态,解锁之后就再也不会锁屏了开机不锁屏

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

/**    
 * External apps (like the phone app) can tell us to disable the keygaurd.   
 */  
 private boolean mExternallyEnabled = true;改为false

你可能感兴趣的:(Android源码去掉开机自动锁屏)