android 设置永不休眠

在alps\frameworks\base\packages\SettingsProvider\res\values\defaults.xml中
设置def_screen_off_timeout为-1,即
-1
同时请注意,经由下面的操作,setting里面休眠时间的Never菜单才会出来:
修改alps\packages\apps\Settings\res\values\arrays.xml:


15 seconds
30 seconds
1 minute
2 minutes
10 minutes
30 minutes
never




15000

30000

60000

120000

600000

1800000
-1

修改对比语言value文件夹下的arrays.xml, 修改screen_timeout_entries对应的翻
译。不用管那个msgid,只是google用来表示是他自己的资源而已,直接添加 >"永不"即可,请知悉。
2.在前面的修改基础上再修改下面的代码:
PowerManagerService.java
private void updateUserActivitySummaryLocked(long now, int dirty) {
.....
//change code here ==============
Slog.d(TAG,"mScreenOffTimeoutSetting ="+mScreenOffTimeoutSetting);
//if (mUserActivitySummary != 0 ) {
if (mUserActivitySummary != 0 && mScreenOffTimeoutSetting > 0) {
//change code here  end ==============
Message msg = mHandler.obtainMessage(MSG_USER_ACTIVITY_TIMEOUT);
msg.setAsynchronous(true);
mHandler.sendMessageAtTime(msg, nextTimeout);
}

你可能感兴趣的:(MTK_android系统开发)