summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Friedman <dmail@google.com> 2017-10-25 06:48:22 +0000
committer android-build-merger <android-build-merger@google.com> 2017-10-25 06:48:22 +0000
commit25c008d9b16bb705e47c3b7371ef3ef3695e50d2 (patch)
treee69602f67169b5fde5c59c9415352ccd459021e9
parent45829c0c41fd10aad28c0c2886a3f6cf05be5b46 (diff)
parent44cd5b97ad6a131a51ba95473769839e2dcb6269 (diff)
Merge "Docs: Adds brief instructions for how to do Wi-Fi scan. Bug: 67967771 Test: Ran make ds-docs." into oc-dev
am: 44cd5b97ad Change-Id: I228d7395c9de8e164a0110c0d4fdf4530c7690ec
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 4684c77ddb4d..ddfe9e7b27ee 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -68,6 +68,7 @@ import java.util.concurrent.CountDownLatch;
* leaks within the calling process.
* <p>
* It deals with several categories of items:
+ * </p>
* <ul>
* <li>The list of configured networks. The list can be viewed and updated, and
* attributes of individual entries can be modified.</li>
@@ -79,9 +80,11 @@ import java.util.concurrent.CountDownLatch;
* <li>It defines the names of various Intent actions that are broadcast upon
* any sort of change in Wi-Fi state.
* </ul>
+ * <p>
* This is the API to use when performing Wi-Fi specific operations. To perform
* operations that pertain to network connectivity at an abstract level, use
* {@link android.net.ConnectivityManager}.
+ * </p>
*/
@SystemService(Context.WIFI_SERVICE)
public class WifiManager {
@@ -1553,7 +1556,21 @@ public class WifiManager {
* 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.
- * @return {@code true} if the operation succeeded, i.e., the scan was initiated
+ * <p>
+ * To initiate a Wi-Fi scan, declare the
+ * {@link android.Manifest.permission#CHANGE_WIFI_STATE}
+ * permission in the manifest, and perform these steps:
+ * </p>
+ * <ol style="1">
+ * <li>Invoke the following method:
+ * {@code ((WifiManager) getSystemService(WIFI_SERVICE)).startScan()}</li>
+ * <li>
+ * Register a BroadcastReceiver to listen to
+ * {@code SCAN_RESULTS_AVAILABLE_ACTION}.</li>
+ * <li>When a broadcast is received, call:
+ * {@code ((WifiManager) getSystemService(WIFI_SERVICE)).getScanResults()}</li>
+ * </ol>
+ * @return {@code true} if the operation succeeded, i.e., the scan was initiated.
*/
public boolean startScan() {
return startScan(null);