summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2013-03-20 15:49:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-20 15:49:20 +0000
commit63f1e2fb6b7102490b11523589b82c2101d3c079 (patch)
tree06e6d2b718a882043cef77cbd29ca32431d16c19 /wifi
parentec3928bf0993e13fb82c65ac26a4d70f5bc6c5e4 (diff)
parent1ef840cdc785d0e8a07e317cc1d7af42a0d0185d (diff)
downloadframeworks_base-63f1e2fb6b7102490b11523589b82c2101d3c079.zip
frameworks_base-63f1e2fb6b7102490b11523589b82c2101d3c079.tar.gz
frameworks_base-63f1e2fb6b7102490b11523589b82c2101d3c079.tar.bz2
Merge "Add API to control scan always mode" into jb-mr2-dev
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl2
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java31
2 files changed, 31 insertions, 2 deletions
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index e0684fb..f093b52 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -73,8 +73,6 @@ interface IWifiManager
boolean isScanningAlwaysAvailable();
- void setScanningAlwaysAvailable(boolean enable);
-
boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws);
void updateWifiLockWorkSource(IBinder lock, in WorkSource ws);
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index a2df64b..f654310 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -393,6 +393,21 @@ public class WifiManager {
public static final String NETWORK_IDS_CHANGED_ACTION = "android.net.wifi.NETWORK_IDS_CHANGED";
/**
+ * Activity Action: Show a system activity that allows the user to enable
+ * scans to be available even with Wi-Fi turned off.
+ *
+ * <p>Notification of the result of this activity is posted using the
+ * {@link android.app.Activity#onActivityResult} callback. The
+ * <code>resultCode</code>
+ * will be {@link android.app.Activity#RESULT_OK} if scan always mode has
+ * been turned on or {@link android.app.Activity#RESULT_CANCELED} if the user
+ * has rejected the request or an error has occurred.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE =
+ "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
+
+ /**
* Activity Action: Pick a Wi-Fi network to connect to.
* <p>Input: Nothing.
* <p>Output: Nothing.
@@ -763,6 +778,22 @@ public class WifiManager {
}
/**
+ * Check if scanning is always available.
+ *
+ * If this return {@code true}, apps can issue {@link #startScan} and fetch scan results
+ * even when Wi-Fi is turned off.
+ *
+ * To change this setting, see {@link #ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE}.
+ */
+ public boolean isScanningAlwaysAvailable() {
+ try {
+ return mService.isScanningAlwaysAvailable();
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /**
* Tell the supplicant to persist the current list of configured networks.
* <p>
* Note: It is possible for this method to change the network IDs of