android自动息屏时间修改,Android
Android 永不锁屏,开机不锁屏,删除设置中休眠时间选项
Android 6.0.1
1.Settings 删掉屏幕待机选项
packages/apps/Settings/res/xml/display_settings.xml
注释掉这个ListPreference
packages/apps/Settings/src/com/android/settings/DisplaySettings.java
添加if条件,如果没有找到这个preference就不执行相关操作;具体可以参考被隐藏的 night_mode
mScreenTimeoutPreference = (ListPreference) findPreference(KEY_SCREEN_TIMEOUT);
if (mScreenTimeoutPreference !=null ) {
final long currentTimeout = Settings.System.getLong(resolver, SCREEN_OFF_TIMEOUT,
FALLBACK_SCREEN_TIMEOUT_VALUE);
mScreenTimeoutPreference.setValue(String.valueOf(currentTimeout));
mScreenTimeoutPreference.setOnPreferenceChangeListener(this);
disableUnusableTimeouts(mScreenTimeoutPreference);
updateTimeoutPreferenceDescription(currentTimeout);
}
2.禁止锁屏
frameworks/base/packages/Se
android自动息屏时间修改,Android
Android 永不锁屏,开机不锁屏,删除设置中休眠时间选项
Android 6.0.1
1.Settings 删掉屏幕待机选项
packages/apps/Settings/res/xml/display_settings.xml
注释掉这个ListPreference
packages/apps/Settings/src/com/android/settings/DisplaySettings.java
添加if条件,如果没有找到这个preference就不执行相关操作;具体可以参考被隐藏的 night_mode
mScreenTimeoutPreference = (ListPreference) findPreference(KEY_SCREEN_TIMEOUT);
if (mScreenTimeoutPreference !=null ) {
final long currentTimeout = Settings.System.getLong(resolver, SCREEN_OFF_TIMEOUT,
FALLBACK_SCREEN_TIMEOUT_VALUE);
mScreenTimeoutPreference.setValue(String.valueOf(currentTimeout));
mScreenTimeoutPreference.setOnPreferenceChangeListener(this);
disableUnusableTimeouts(mScreenTimeoutPreference);
updateTimeoutPreferenceDescription(currentTimeout);
}
2.禁止锁屏
frameworks/base/packages/Se