@@ -219,15 +219,16 @@ public void testWifiScanning() {
219219 // Stress Wifi reconnection to secure net after sleep
220220 @ LargeTest
221221 public void testWifiReconnectionAfterSleep () {
222- int value = Settings .System .getInt (mRunner .getContext ().getContentResolver (),
223- Settings .System .WIFI_SLEEP_POLICY , -1 );
224- if (value < 0 ) {
225- Settings .System .putInt (mRunner .getContext ().getContentResolver (),
226- Settings .System .WIFI_SLEEP_POLICY , Settings .System .WIFI_SLEEP_POLICY_DEFAULT );
222+ int value = Settings .Global .getInt (mRunner .getContext ().getContentResolver (),
223+ Settings .Global .WIFI_SLEEP_POLICY , -1 );
224+ log ("wifi sleep policy is: " + value );
225+ if (value != Settings .Global .WIFI_SLEEP_POLICY_DEFAULT ) {
226+ Settings .Global .putInt (mRunner .getContext ().getContentResolver (),
227+ Settings .Global .WIFI_SLEEP_POLICY , Settings .Global .WIFI_SLEEP_POLICY_DEFAULT );
227228 log ("set wifi sleep policy to default value" );
228229 }
229- Settings .Secure .putLong (mRunner .getContext ().getContentResolver (),
230- Settings .Secure .WIFI_IDLE_MS , WIFI_IDLE_MS );
230+ Settings .Global .putLong (mRunner .getContext ().getContentResolver (),
231+ Settings .Global .WIFI_IDLE_MS , WIFI_IDLE_MS );
231232
232233 // Connect to a Wi-Fi network
233234 WifiConfiguration config = new WifiConfiguration ();
0 commit comments