summaryrefslogtreecommitdiffstats
path: root/core/tests/ConnectivityManagerTest
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2012-07-02 15:58:28 -0700
committerIrfan Sheriff <isheriff@google.com>2012-07-24 13:34:36 -0700
commit88759bbd31e05a4163e1f8e72804ca83000afd53 (patch)
treef795fd767a7e3466624a6108fc308cc96d88f528 /core/tests/ConnectivityManagerTest
parentb10f455e4494de687634aed1e24fc8f7edff427a (diff)
downloadframeworks_base-88759bbd31e05a4163e1f8e72804ca83000afd53.zip
frameworks_base-88759bbd31e05a4163e1f8e72804ca83000afd53.tar.gz
frameworks_base-88759bbd31e05a4163e1f8e72804ca83000afd53.tar.bz2
Update WifiManager API
Use feedback based on NSD to update WifiManager API Change-Id: I0c1dc74f7e2fa7cd697a995b7194e3e0366d7981
Diffstat (limited to 'core/tests/ConnectivityManagerTest')
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java6
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java20
2 files changed, 2 insertions, 24 deletions
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index f01562c..6630601 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -94,7 +94,6 @@ public class ConnectivityManagerTestActivity extends Activity {
* Control Wifi States
*/
public WifiManager mWifiManager;
- public WifiManager.Channel mChannel;
/*
* Verify connectivity state
@@ -242,7 +241,6 @@ public class ConnectivityManagerTestActivity extends Activity {
// Get an instance of WifiManager
mWifiManager =(WifiManager)getSystemService(Context.WIFI_SERVICE);
mContext = this;
- mChannel = mWifiManager.initialize(mContext, mContext.getMainLooper(), null);
if (mWifiManager.isWifiApEnabled()) {
// if soft AP is enabled, disable it
@@ -599,7 +597,7 @@ public class ConnectivityManagerTestActivity extends Activity {
log("found " + ssid + " in the scan result list");
log("retry: " + retry);
foundApInScanResults = true;
- mWifiManager.connect(mChannel, config,
+ mWifiManager.connect(config,
new WifiManager.ActionListener() {
public void onSuccess() {
}
@@ -658,7 +656,7 @@ public class ConnectivityManagerTestActivity extends Activity {
for (WifiConfiguration wifiConfig: wifiConfigList) {
log("remove wifi configuration: " + wifiConfig.networkId);
int netId = wifiConfig.networkId;
- mWifiManager.forget(mChannel, netId, new WifiManager.ActionListener() {
+ mWifiManager.forget(netId, new WifiManager.ActionListener() {
public void onSuccess() {
}
public void onFailure(int reason) {
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
index 8d73bc0..81075ef 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
@@ -63,7 +63,6 @@ public class WifiConnectionTest
private ConnectivityManagerTestActivity mAct;
private ConnectivityManagerTestRunner mRunner;
private WifiManager mWifiManager = null;
- private WifiManager.Channel mChannel;
private Set<WifiConfiguration> enabledNetworks = null;
public WifiConnectionTest() {
@@ -77,7 +76,6 @@ public class WifiConnectionTest
mWifiManager = (WifiManager) mRunner.getContext().getSystemService(Context.WIFI_SERVICE);
mAct = getActivity();
- mChannel = mWifiManager.initialize(mAct, mAct.getMainLooper(), null);
networks = mAct.loadNetworkConfigurations();
if (DEBUG) {
@@ -93,24 +91,6 @@ public class WifiConnectionTest
assertTrue("wpa_supplicant is not started ", mAct.mWifiManager.pingSupplicant());
}
- private class WifiServiceHandler extends Handler {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
- if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) {
- //AsyncChannel in msg.obj
- } else {
- log("Failed to establish AsyncChannel connection");
- }
- break;
- default:
- //Ignore
- break;
- }
- }
- }
-
private void printNetworkConfigurations() {
log("==== print network configurations parsed from XML file ====");
log("number of access points: " + networks.size());