bigbaicai

文章转自一牛网论坛 一牛网旗下拥有一牛网论坛、一牛网元器件商城、一牛网技术众包平台等一系列服务于广大工程师的平台,让研发更快、更便捷!

ICS版本上,WLAN_怎么设置休眠策略 默认为仅限充电时那项

0
阅读(85) 评论(0)

“在休眠状态下保持WLAN连接”设置成仅限充电时那项


请做如下修改:
alps\Frameworks\base\services\java\com\android\server\WifiService.java
private boolean shouldWifiStayAwake(int stayAwakeConditions, int
pluggedType) {
//Never sleep as long as the user has not changed the settings
int defaultValue = Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED ;
//int defaultValue = Settings.System.WIFI_SLEEP_POLICY_NEVER; change
alps\packages\apps\settings\src\com\android\settings\wifi\AdvancedWifiSett
ings.java
private void initPreferences() {
if(Utils.isCmccLoad()){
value = Settings.System.getInt(getContentResolver(),
Settings.System.WIFI_SLEEP_POLICY,
Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED);
// Settings.System.WIFI_SLEEP_POLICY_DEFAULT); change
}else{
value = Settings.System.getInt(getContentResolver(),
Settings.System.WIFI_SLEEP_POLICY,
Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED);
// Settings.System.WIFI_SLEEP_POLICY_NEVER); change
}


文章转自一牛网论坛,原文链接:http://bbs.16rd.com/thread-54046-1-1.html