diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-09 14:27:38 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-07-09 14:27:38 -0700 |
commit | 6811355d9683412cb3651e75c59c3256ceaddcec (patch) | |
tree | a69b7952f5263746a90772bb2b2adaf63a33b530 /wifi | |
parent | 58e8131631b4598d445303183ee6ea80b7e63038 (diff) | |
parent | 463aacfbd220c9ef2f6ed915d54092289fdac05b (diff) | |
download | frameworks_base-6811355d9683412cb3651e75c59c3256ceaddcec.zip frameworks_base-6811355d9683412cb3651e75c59c3256ceaddcec.tar.gz frameworks_base-6811355d9683412cb3651e75c59c3256ceaddcec.tar.bz2 |
am 463aacfb: Merge change 6661 into donut
Merge commit '463aacfbd220c9ef2f6ed915d54092289fdac05b'
* commit '463aacfbd220c9ef2f6ed915d54092289fdac05b':
wifi: WifiManager.startScan() will now do passive scans by default.
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/IWifiManager.aidl | 2 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 22 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiNative.java | 2 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 2 |
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 c31577c..73dbb6f 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 79b8fc4..2ee1945 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 0920567..c3c519f 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 f84bccc..afbb19b 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -1129,7 +1129,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); } } } |