diff options
| author | 2019-11-07 10:13:56 -0800 | |
|---|---|---|
| committer | 2019-11-15 10:14:33 -0800 | |
| commit | c67d4f750e12acbf4c7ff46fbd5130f4c7056e03 (patch) | |
| tree | 57564d89ced9979dcfd1364497d093a5472b909d | |
| parent | eb630065d6d85245916bdbbac9c05b6eb6ca3e45 (diff) | |
Wifi: Support check on device capability for 6GHZ
This commit implements support of checking whether device supports 6GHz band.
Bug: 139354972
Test: atest com.android.wifi.server
Change-Id: Id2c1ef085bb680b9d59ce1788147b154efc4b422
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 11 | ||||
| -rw-r--r-- | wifi/tests/src/android/net/wifi/WifiManagerTest.java | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index bb2a1fb49c7b..41a33e7bc930 100644 --- a/api/current.txt +++ b/api/current.txt @@ -30057,6 +30057,7 @@ package android.net.wifi { method public java.util.List<android.net.wifi.ScanResult> getScanResults(); method public int getWifiState(); method public boolean is5GHzBandSupported(); + method public boolean is6GHzBandSupported(); method @Deprecated public boolean isDeviceToApRttSupported(); method public boolean isEasyConnectSupported(); method public boolean isEnhancedOpenSupported(); diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 93960de89d89..84327e867c9b 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -2257,6 +2257,8 @@ public class WifiManager { public static final long WIFI_FEATURE_MBO = 0x800000000L; // MBO Support /** @hide */ public static final long WIFI_FEATURE_OCE = 0x1000000000L; // OCE Support + /** @hide */ + public static final long WIFI_FEATURE_INFRA_6G = 0x2000000000L; // Support 6 GHz band private long getSupportedFeatures() { try { @@ -2271,6 +2273,7 @@ public class WifiManager { private boolean isFeatureSupported(long feature) { return (getSupportedFeatures() & feature) == feature; } + /** * @return true if this adapter supports 5 GHz band */ @@ -2279,6 +2282,14 @@ public class WifiManager { } /** + * @return true if the device supports operating in the 6 GHz band and Wi-Fi is enabled, + * false otherwise. + */ + public boolean is6GHzBandSupported() { + return isFeatureSupported(WIFI_FEATURE_INFRA_6G); + } + + /** * @return true if this adapter supports Passpoint * @hide */ diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java index 17f3bb2b130b..305149f44d1c 100644 --- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java +++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java @@ -1586,6 +1586,7 @@ public class WifiManagerTest { assertTrue(mWifiManager.isP2pSupported()); assertFalse(mWifiManager.isPortableHotspotSupported()); assertFalse(mWifiManager.is5GHzBandSupported()); + assertFalse(mWifiManager.is6GHzBandSupported()); assertFalse(mWifiManager.isDeviceToDeviceRttSupported()); assertFalse(mWifiManager.isDeviceToApRttSupported()); assertFalse(mWifiManager.isPreferredNetworkOffloadSupported()); |