summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-11-02 16:12:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-02 16:12:13 -0700
commitacc863cabbd6c03f4fe58e568f5bb3d119943ea9 (patch)
tree8c99ece8868f0419954faeaa1c931d45cd7c6835 /services
parentc68134b74016b82e0c49c47b89d93b2d0921cbe5 (diff)
parent1406bcb75150e8386b4d858f27089cc1359e7f14 (diff)
downloadframeworks_base-acc863cabbd6c03f4fe58e568f5bb3d119943ea9.zip
frameworks_base-acc863cabbd6c03f4fe58e568f5bb3d119943ea9.tar.gz
frameworks_base-acc863cabbd6c03f4fe58e568f5bb3d119943ea9.tar.bz2
Merge "Use AsynChannel for synchronous API"
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/WifiService.java35
1 files changed, 30 insertions, 5 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 2008215..55d69f0 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -423,7 +423,12 @@ public class WifiService extends IWifiManager.Stub {
*/
public boolean pingSupplicant() {
enforceAccessPermission();
- return mWifiStateMachine.syncPingSupplicant();
+ if (mChannel != null) {
+ return mWifiStateMachine.syncPingSupplicant(mChannel);
+ } else {
+ Slog.e(TAG, "mChannel is not initialized");
+ return false;
+ }
}
/**
@@ -634,7 +639,12 @@ public class WifiService extends IWifiManager.Stub {
*/
public int addOrUpdateNetwork(WifiConfiguration config) {
enforceChangePermission();
- return mWifiStateMachine.syncAddOrUpdateNetwork(config);
+ if (mChannel != null) {
+ return mWifiStateMachine.syncAddOrUpdateNetwork(mChannel, config);
+ } else {
+ Slog.e(TAG, "mChannel is not initialized");
+ return -1;
+ }
}
/**
@@ -662,7 +672,12 @@ public class WifiService extends IWifiManager.Stub {
*/
public boolean enableNetwork(int netId, boolean disableOthers) {
enforceChangePermission();
- return mWifiStateMachine.syncEnableNetwork(netId, disableOthers);
+ if (mChannel != null) {
+ return mWifiStateMachine.syncEnableNetwork(mChannel, netId, disableOthers);
+ } else {
+ Slog.e(TAG, "mChannel is not initialized");
+ return false;
+ }
}
/**
@@ -673,7 +688,12 @@ public class WifiService extends IWifiManager.Stub {
*/
public boolean disableNetwork(int netId) {
enforceChangePermission();
- return mWifiStateMachine.syncDisableNetwork(netId);
+ if (mChannel != null) {
+ return mWifiStateMachine.syncDisableNetwork(mChannel, netId);
+ } else {
+ Slog.e(TAG, "mChannel is not initialized");
+ return false;
+ }
}
/**
@@ -708,7 +728,12 @@ public class WifiService extends IWifiManager.Stub {
public boolean saveConfiguration() {
boolean result = true;
enforceChangePermission();
- return mWifiStateMachine.syncSaveConfig();
+ if (mChannel != null) {
+ return mWifiStateMachine.syncSaveConfig(mChannel);
+ } else {
+ Slog.e(TAG, "mChannel is not initialized");
+ return false;
+ }
}
/**