summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-07-08 17:11:17 -0400
committerMike Lockwood <lockwood@android.com>2009-07-09 16:54:39 -0400
commita5ec95cdb1a7d2024249277dff1f99d0046c9b56 (patch)
tree5bf844072a7e160dede6dd2e68bce8c3349e355d /wifi/java/android/net
parentd1e5e3ffc22478bad8525dec4f1c6d57fe0ad368 (diff)
downloadframeworks_base-a5ec95cdb1a7d2024249277dff1f99d0046c9b56.zip
frameworks_base-a5ec95cdb1a7d2024249277dff1f99d0046c9b56.tar.gz
frameworks_base-a5ec95cdb1a7d2024249277dff1f99d0046c9b56.tar.bz2
wifi: WifiManager.startScan() will now do passive scans by default.
Active scans will only happen if a hidden AP is in use, or if the new method WifiManager.startScanActive() is called. This fixes some audio playback problems with bluetooth A2DP. Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl2
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java22
-rw-r--r--wifi/java/android/net/wifi/WifiNative.java2
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java2
4 files changed, 23 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 3d65d3c..fa328e8 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -40,7 +40,7 @@ interface IWifiManager
boolean pingSupplicant();
- boolean startScan();
+ boolean startScan(boolean forceActive);
List<ScanResult> getScanResults();
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 7a15f27..1f73bec 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -476,9 +476,27 @@ public class WifiManager {
* on completion of the scan.
* @return {@code true} if the operation succeeded, i.e., the scan was initiated
*/
- public boolean startScan() {
+ public boolean startScan() {
try {
- return mService.startScan();
+ return mService.startScan(false);
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /**
+ * Request a scan for access points. Returns immediately. The availability
+ * of the results is made known later by means of an asynchronous event sent
+ * on completion of the scan.
+ * This is a variant of startScan that forces an active scan, even if passive
+ * scans are the current default
+ * @return {@code true} if the operation succeeded, i.e., the scan was initiated
+ *
+ * @hide
+ */
+ public boolean startScanActive() {
+ try {
+ return mService.startScan(true);
} catch (RemoteException e) {
return false;
}
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java
index 3851ac0..0799f5f 100644
--- a/wifi/java/android/net/wifi/WifiNative.java
+++ b/wifi/java/android/net/wifi/WifiNative.java
@@ -51,7 +51,7 @@ public class WifiNative {
public native static boolean pingCommand();
- public native static boolean scanCommand();
+ public native static boolean scanCommand(boolean forceActive);
public native static boolean setScanModeCommand(boolean setActive);
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index 2fbc779..63687b3 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -1121,7 +1121,7 @@ public class WifiStateTracker extends NetworkStateTracker {
} else {
// In some situations, supplicant needs to be kickstarted to
// start the background scanning
- WifiNative.scanCommand();
+ WifiNative.scanCommand(true);
}
}
}