Skip to content

Commit 3272a38

Browse files
author
Xia Wang
committed
Fix Wifi Stress test after wifi settings are moved to Settings.global
Change-Id: I823e99b39bc340683b686bb0dd43a473865656f0
1 parent 2832136 commit 3272a38

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)