diff options
author | Vinit Deshpande <vinitd@google.com> | 2014-09-05 20:43:57 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2014-09-05 20:43:57 -0700 |
commit | 15f89078784d44006f7ed0c0f34a5e3fbc3d840c (patch) | |
tree | b342ed84785e2cd2827d2626acc86da86a57ab37 /wifi/java/android/net | |
parent | 8eca9e0f0b7bee0d11dc410ba7be3b4c0eb8ffa8 (diff) | |
download | frameworks_base-15f89078784d44006f7ed0c0f34a5e3fbc3d840c.zip frameworks_base-15f89078784d44006f7ed0c0f34a5e3fbc3d840c.tar.gz frameworks_base-15f89078784d44006f7ed0c0f34a5e3fbc3d840c.tar.bz2 |
Implement getAvailableChannels
This API allows finding channels by band, so scanning services
can find out which channels to use.
Bug: 16652660
Change-Id: I690825333988a336efa3fc8886297e5b8baf8e1d
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r-- | wifi/java/android/net/wifi/IWifiScanner.aidl | 3 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiScanner.java | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/IWifiScanner.aidl b/wifi/java/android/net/wifi/IWifiScanner.aidl index fef2d11..3984934 100644 --- a/wifi/java/android/net/wifi/IWifiScanner.aidl +++ b/wifi/java/android/net/wifi/IWifiScanner.aidl @@ -17,6 +17,7 @@ package android.net.wifi; import android.os.Messenger; +import android.os.Bundle; /** * {@hide} @@ -24,4 +25,6 @@ import android.os.Messenger; interface IWifiScanner { Messenger getMessenger(); + + Bundle getAvailableChannels(int band); } diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java index e7bcb23..65c00bd 100644 --- a/wifi/java/android/net/wifi/WifiScanner.java +++ b/wifi/java/android/net/wifi/WifiScanner.java @@ -18,6 +18,7 @@ package android.net.wifi; import android.annotation.SystemApi; import android.content.Context; +import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; @@ -76,6 +77,9 @@ public class WifiScanner { /** Invalid request */ public static final int REASON_INVALID_REQUEST = -3; + /** @hide */ + public static final String GET_AVAILABLE_CHANNELS_EXTRA = "Channels"; + /** * Generic action callback invocation interface * @hide @@ -92,7 +96,12 @@ public class WifiScanner { * @hide */ public List<Integer> getAvailableChannels(int band) { - return null; + try { + Bundle bundle = mService.getAvailableChannels(band); + return bundle.getIntegerArrayList(GET_AVAILABLE_CHANNELS_EXTRA); + } catch (RemoteException e) { + return null; + } } /** |