From 96b10d669ef01c392ad186812b30cdfe1052f897 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Tue, 11 Jan 2011 15:40:35 -0800 Subject: [PATCH] default wifi sleep policy change Keep wifi sleep policy as never when charged as long as user has not changed the settings Bug: 3038345 Change-Id: I0598af41fe0144f2dfddc5bd331bd91d91e0ffea --- services/java/com/android/server/WifiService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index cff9892866001..1b590ba2190b4 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -954,8 +954,10 @@ public class WifiService extends IWifiManager.Stub { * @see #shouldDeviceStayAwake(int, int) */ private boolean shouldWifiStayAwake(int stayAwakeConditions, int pluggedType) { + //Never sleep when plugged in as long as the user has not changed the settings int wifiSleepPolicy = Settings.System.getInt(mContext.getContentResolver(), - Settings.System.WIFI_SLEEP_POLICY, Settings.System.WIFI_SLEEP_POLICY_DEFAULT); + Settings.System.WIFI_SLEEP_POLICY, + Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED); if (wifiSleepPolicy == Settings.System.WIFI_SLEEP_POLICY_NEVER) { // Never sleep