summaryrefslogtreecommitdiffstats
path: root/core/tests/ConnectivityManagerTest
diff options
context:
space:
mode:
authorXia Wang <xiaw@google.com>2012-05-06 16:03:34 -0700
committerXia Wang <xiaw@google.com>2012-05-06 16:03:34 -0700
commit81341fee6de80d8808afd8af3009258660a8f834 (patch)
tree071d9664901c590f45e52c98a15124de75333bf0 /core/tests/ConnectivityManagerTest
parent6aa3138587198c6ddf529c0daee84eea6ea05549 (diff)
downloadframeworks_base-81341fee6de80d8808afd8af3009258660a8f834.zip
frameworks_base-81341fee6de80d8808afd8af3009258660a8f834.tar.gz
frameworks_base-81341fee6de80d8808afd8af3009258660a8f834.tar.bz2
Fix Wifi test
bug: http://b/issue?id=6446248 Change-Id: I22783ed3de37bf51aed7cee9617017868f524f0d
Diffstat (limited to 'core/tests/ConnectivityManagerTest')
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index 19aa77b..f7b0cd0 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -246,9 +246,7 @@ public class ConnectivityManagerTestActivity extends Activity {
initializeNetworkStates();
- mWifiManager.setWifiEnabled(true);
log("Clear Wifi before we start the test.");
- sleep(SHORT_TIMEOUT);
removeConfiguredNetworksAndDisableWifi();
mWifiRegexs = mCM.getTetherableWifiRegexs();
}
@@ -645,6 +643,11 @@ public class ConnectivityManagerTestActivity extends Activity {
*/
public boolean disconnectAP() {
// remove saved networks
+ if (!mWifiManager.isWifiEnabled()) {
+ log("Enabled wifi before remove configured networks");
+ mWifiManager.setWifiEnabled(true);
+ sleep(SHORT_TIMEOUT);
+ }
List<WifiConfiguration> wifiConfigList = mWifiManager.getConfiguredNetworks();
log("size of wifiConfigList: " + wifiConfigList.size());
for (WifiConfiguration wifiConfig: wifiConfigList) {