本文主要是介绍Android5.1系统设置和修改,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Android 系统关闭自动休眠
1. 修改default值,不自动休眠
/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
修改def_screen_off_timeout为-1
2.frameworks/base/services/core/Java/com/Android/server/power/PowerManagerService.java
修改PowerManagerService.java文件getScreenOffTimeoutLocked()函数
修改前:
private int getScreenOffTimeoutLocked(int sleepTimeout) {
int timeout = mScreenOffTimeoutSetting;
if (isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
timeout = Math.min(timeout, mMaximumScreenOffTimeoutFromDeviceAdmin);
}
if (mUserActivityTimeoutOverrideFromWindowManager >= 0) {
timeout = (int)Math.min(timeout, mUserActivityTimeoutOverrideFromWindowManager);
}
if (sleepTimeout >= 0) {
timeout = Math.min(timeout, sleepTimeout);
}
return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
}
修改后:
private int getScreenOffTimeoutLocked(int sleepTimeout) {
int nosleep;
int timeout = mScreenOffTimeoutSetting;
if (isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
timeout = Math.min(timeout, mMaximumScreenOffTimeoutFromDeviceAdmin);
}
if (mUserActivityTimeoutOverrideFromWindowManager >= 0) {
timeout = (int)Math.min(timeout, mUserActivityTimeoutOverrideFromWindowManager);
}
if (sleepTimeout >= 0) {
timeout = Math.min(timeout, sleepTimeout);
}
nosleep = mScreenOffTimeoutSetting;
if(nosleep < 0)
{
nosleep = mMaximumScreenOffTimeoutFromDeviceAdmin ;
return Math.max(nosleep, mMaximumScreenOffTimeoutFromDeviceAdmin);
}
return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
}
屏幕一直亮
更改系统设置,当插入电源时,屏幕一直亮,涉及文件:
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
loadSetting(stmt, Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
("1".equals(SystemProperties.get("ro.kernel.qemu")) ||
mContext.getResources().getBoolean(R.bool.def_stay_on_while_plugged_in))
? 1 : 1); //? 1 : 0); leavs patched.the '1' can let the android stay wake when plugged in.------------fixed by lqy-----------
开机不锁屏
1. 修改default值,去除锁屏
/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<bool name="def_lockscreen_disabled">true</bool>
关闭系统bluetooth
http://blog.csdn.net/yinlijun2004/article/details/9724347
在external/bluetooth/bluedroid/Android.mk文件中添加
ifeq ($(BOARD_HAVE_BLUETOOTH_RTK),true)
。。。。
。。。。
endif #BOARD_HAVE_BLUETOOTH_RTK
在device/fsl/sabresd_6dq/BoardConfig.mk文件中添加如下内容
#Realtek add start
BOARD_HAVE_BLUETOOTH_RTK := false
#Realtek add end
这篇关于Android5.1系统设置和修改的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!