Skip to content

Commit b4510e3

Browse files
Xia WangAndroid (Google) Code Review
authored andcommitted
Merge "Fix Wifi Stress test after wifi settings are moved to Settings.global" into jb-mr1-dev
2 parents 4368ba4 + 3272a38 commit b4510e3

File tree

1 file changed

+8
-7
lines changed
  • core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress

1 file changed

+8
-7
lines changed

core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)