mContext = this;
mChannel = mWifiManager.initialize(mContext, mContext.getMainLooper(), null);
- initializeNetworkStates();
+ if (mWifiManager.isWifiApEnabled()) {
+ // if soft AP is enabled, disable it
+ mWifiManager.setWifiApEnabled(null, false);
+ log("Disable soft ap");
+ }
+ initializeNetworkStates();
log("Clear Wifi before we start the test.");
removeConfiguredNetworksAndDisableWifi();
mWifiRegexs = mCM.getTetherableWifiRegexs();
assertTrue(mAct.mWifiManager.setWifiApEnabled(config, true));
// Wait for wifi ap state to be ENABLED
assertTrue(mAct.waitForWifiAPState(WifiManager.WIFI_AP_STATE_ENABLED,
- ConnectivityManagerTestActivity.LONG_TIMEOUT));
+ 2 * ConnectivityManagerTestActivity.LONG_TIMEOUT));
// Wait for wifi tethering result
assertEquals(ConnectivityManagerTestActivity.SUCCESS,
mAct.waitForTetherStateChange(2*ConnectivityManagerTestActivity.SHORT_TIMEOUT));
@Override
public void setUp() throws Exception {
super.setUp();
+
mAct = getActivity();
mRunner = (ConnectivityManagerStressTestRunner) getInstrumentation();
mReconnectIterations = mRunner.mReconnectIterations;
mOutputWriter = new BufferedWriter(new FileWriter(new File(
Environment.getExternalStorageDirectory(), OUTPUT_FILE), true));
mAct.turnScreenOn();
- if (mAct.mWifiManager.isWifiApEnabled()) {
- // if soft AP is enabled, disable it
- assertTrue(mAct.mWifiManager.setWifiApEnabled(null, false));
- Log.v(TAG, "disable soft ap");
- }
if (!mAct.mWifiManager.isWifiEnabled()) {
log("Enable wi-fi before stress tests.");
if (!mAct.enableWifi()) {