diff options
author | Xia Wang <xiaw@google.com> | 2012-05-15 14:45:12 -0700 |
---|---|---|
committer | Xia Wang <xiaw@google.com> | 2012-05-15 16:10:55 -0700 |
commit | 2f19a3103c2cdcf5613eb70493122fb366d509ef (patch) | |
tree | a17628daf30598ecd00943f24f2de1b6af7f3a09 | |
parent | 2411c3361eb2c15b09a8bfadf5c7c4a3de092ea0 (diff) | |
download | frameworks_base-2f19a3103c2cdcf5613eb70493122fb366d509ef.zip frameworks_base-2f19a3103c2cdcf5613eb70493122fb366d509ef.tar.gz frameworks_base-2f19a3103c2cdcf5613eb70493122fb366d509ef.tar.bz2 |
Fix issue: Disable soft ap when test activity is created.
Add timer for soft ap enalbing timer: 6192139
Change-Id: I9f9a6a1f0787efdfbb924af80f7d610c07cd32e5
3 files changed, 8 insertions, 7 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java index f7b0cd0..f01562c 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java @@ -244,8 +244,13 @@ public class ConnectivityManagerTestActivity extends Activity { 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(); diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiApStress.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiApStress.java index 7e136be..60595fb 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiApStress.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiApStress.java @@ -103,7 +103,7 @@ public class WifiApStress 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)); diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java index 649ec3e..39e2cf2 100644 --- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java +++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/stress/WifiStressTest.java @@ -83,6 +83,7 @@ public class WifiStressTest @Override public void setUp() throws Exception { super.setUp(); + mAct = getActivity(); mRunner = (ConnectivityManagerStressTestRunner) getInstrumentation(); mReconnectIterations = mRunner.mReconnectIterations; @@ -97,11 +98,6 @@ public class WifiStressTest 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()) { |