summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2010-09-21 12:59:34 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-21 12:59:34 -0700
commitd404a9be14715efdea447ec4ed3e7677ab72e641 (patch)
treed966e1cfdefc94112df84a5e1f6f76073186407c /services
parentb745ec954272a3c09cca354ad84e2e08b54c8544 (diff)
parent0859b764719735e4b9aea5df6051ece13e212841 (diff)
downloadframeworks_base-d404a9be14715efdea447ec4ed3e7677ab72e641.zip
frameworks_base-d404a9be14715efdea447ec4ed3e7677ab72e641.tar.gz
frameworks_base-d404a9be14715efdea447ec4ed3e7677ab72e641.tar.bz2
am 0859b764: Make wifi scan async. (don\'t auto-merge)
Merge commit '0859b764719735e4b9aea5df6051ece13e212841' into gingerbread-plus-aosp * commit '0859b764719735e4b9aea5df6051ece13e212841': Make wifi scan async. (don't auto-merge)
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/WifiService.java33
1 files changed, 19 insertions, 14 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 87329e3..c047e10 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -173,6 +173,7 @@ public class WifiService extends IWifiManager.Stub {
private static final int MESSAGE_STOP_ACCESS_POINT = 7;
private static final int MESSAGE_SET_CHANNELS = 8;
private static final int MESSAGE_ENABLE_NETWORKS = 9;
+ private static final int MESSAGE_START_SCAN = 10;
private final WifiHandler mWifiHandler;
@@ -385,23 +386,12 @@ public class WifiService extends IWifiManager.Stub {
/**
* see {@link android.net.wifi.WifiManager#startScan()}
- * @return {@code true} if the operation succeeds
*/
- public boolean startScan(boolean forceActive) {
+ public void startScan(boolean forceActive) {
enforceChangePermission();
+ if (mWifiHandler == null) return;
- switch (mWifiStateTracker.getSupplicantState()) {
- case DISCONNECTED:
- case INACTIVE:
- case SCANNING:
- case DORMANT:
- break;
- default:
- mWifiStateTracker.setScanResultHandling(
- WifiStateTracker.SUPPL_SCAN_HANDLING_LIST_ONLY);
- break;
- }
- return mWifiStateTracker.scan(forceActive);
+ Message.obtain(mWifiHandler, MESSAGE_START_SCAN, forceActive ? 1 : 0, 0).sendToTarget();
}
/**
@@ -2001,6 +1991,21 @@ public class WifiService extends IWifiManager.Stub {
mWifiStateTracker.enableAllNetworks(getConfiguredNetworks());
break;
+ case MESSAGE_START_SCAN:
+ boolean forceActive = (msg.arg1 == 1);
+ switch (mWifiStateTracker.getSupplicantState()) {
+ case DISCONNECTED:
+ case INACTIVE:
+ case SCANNING:
+ case DORMANT:
+ break;
+ default:
+ mWifiStateTracker.setScanResultHandling(
+ WifiStateTracker.SUPPL_SCAN_HANDLING_LIST_ONLY);
+ break;
+ }
+ mWifiStateTracker.scan(forceActive);
+ break;
}
}
}