summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/system-current.txt1
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl4
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java60
-rw-r--r--wifi/java/com/android/server/wifi/BaseWifiService.java14
-rw-r--r--wifi/tests/src/android/net/wifi/WifiManagerTest.java22
5 files changed, 55 insertions, 46 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 1a83a2caffbe..511c7787df50 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5668,7 +5668,6 @@ package android.net.wifi {
method public boolean isApMacRandomizationSupported();
method public boolean isConnectedMacRandomizationSupported();
method @Deprecated public boolean isDeviceToDeviceRttSupported();
- method public boolean isDualBandSupported();
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public boolean isDualModeSupported();
method public boolean isPortableHotspotSupported();
method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isWifiApEnabled();
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index b52880e29e30..0a1254de269d 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -108,7 +108,9 @@ interface IWifiManager
String getCountryCode();
- boolean isDualBandSupported();
+ boolean is5GHzBandSupported();
+
+ boolean is6GHzBandSupported();
boolean needs5GHzToAnyApBandConversion();
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 50d62a0b627e..295e05e71825 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -2156,8 +2156,6 @@ public class WifiManager {
/** @hide */
public static final long WIFI_FEATURE_INFRA = 0x0001L; // Basic infrastructure mode
/** @hide */
- public static final long WIFI_FEATURE_INFRA_5G = 0x0002L; // Support for 5 GHz Band
- /** @hide */
public static final long WIFI_FEATURE_PASSPOINT = 0x0004L; // Support for GAS/ANQP
/** @hide */
public static final long WIFI_FEATURE_P2P = 0x0008L; // Wifi-Direct
@@ -2227,8 +2225,6 @@ 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 {
@@ -2242,22 +2238,7 @@ public class WifiManager {
return (getSupportedFeatures() & feature) == feature;
}
- /**
- * @return true if this adapter supports 5 GHz band
- */
- public boolean is5GHzBandSupported() {
- return isFeatureSupported(WIFI_FEATURE_INFRA_5G);
- }
-
- /**
- * @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
*/
@@ -2379,6 +2360,30 @@ public class WifiManager {
}
/**
+ * Check if the chipset supports 5GHz band.
+ * @return {@code true} if supported, {@code false} otherwise.
+ */
+ public boolean is5GHzBandSupported() {
+ try {
+ return mService.is5GHzBandSupported();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Check if the chipset supports 6GHz band.
+ * @return {@code true} if supported, {@code false} otherwise.
+ */
+ public boolean is6GHzBandSupported() {
+ try {
+ return mService.is6GHzBandSupported();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Interface for Wi-Fi activity energy info listener. Should be implemented by applications and
* set when calling {@link WifiManager#getWifiActivityEnergyInfoAsync}.
*
@@ -2592,21 +2597,6 @@ public class WifiManager {
}
/**
- * Check if the chipset supports dual frequency band (2.4 GHz and 5 GHz).
- * No permissions are required to call this method.
- * @return {@code true} if supported, {@code false} otherwise.
- * @hide
- */
- @SystemApi
- public boolean isDualBandSupported() {
- try {
- return mService.isDualBandSupported();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
* Check if the device is dual mode capable i.e. supports concurrent STA + Soft AP.
*
* If the device is dual mode capable, it may require conversion of the user's Soft AP band
diff --git a/wifi/java/com/android/server/wifi/BaseWifiService.java b/wifi/java/com/android/server/wifi/BaseWifiService.java
index 524a53c03305..48f57b82b3e9 100644
--- a/wifi/java/com/android/server/wifi/BaseWifiService.java
+++ b/wifi/java/com/android/server/wifi/BaseWifiService.java
@@ -28,7 +28,6 @@ import android.net.wifi.INetworkRequestMatchCallback;
import android.net.wifi.IOnWifiActivityEnergyInfoListener;
import android.net.wifi.IOnWifiUsabilityStatsListener;
import android.net.wifi.IScanResultsCallback;
-import android.net.wifi.IScanResultsListener;
import android.net.wifi.ISoftApCallback;
import android.net.wifi.ISuggestionConnectionStatusListener;
import android.net.wifi.ITrafficStateCallback;
@@ -227,12 +226,23 @@ public class BaseWifiService extends IWifiManager.Stub {
throw new UnsupportedOperationException();
}
- @Override
+ /** @deprecated use {@link #is5GHzBandSupported} instead */
+ @Deprecated
public boolean isDualBandSupported() {
throw new UnsupportedOperationException();
}
@Override
+ public boolean is5GHzBandSupported() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean is6GHzBandSupported() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public boolean needs5GHzToAnyApBandConversion() {
throw new UnsupportedOperationException();
}
diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
index f92d38c982b8..62ff9f65a1a7 100644
--- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
@@ -1696,8 +1696,6 @@ public class WifiManagerTest {
assertTrue(mWifiManager.isPasspointSupported());
assertTrue(mWifiManager.isP2pSupported());
assertFalse(mWifiManager.isPortableHotspotSupported());
- assertFalse(mWifiManager.is5GHzBandSupported());
- assertFalse(mWifiManager.is6GHzBandSupported());
assertFalse(mWifiManager.isDeviceToDeviceRttSupported());
assertFalse(mWifiManager.isDeviceToApRttSupported());
assertFalse(mWifiManager.isPreferredNetworkOffloadSupported());
@@ -1782,13 +1780,23 @@ public class WifiManagerTest {
}
/**
- * Test behavior of {@link WifiManager#isDualBandSupported()}
+ * Test behavior of {@link WifiManager#is5GHzBandSupported()}
*/
@Test
- public void testIsDualBandSupported() throws Exception {
- when(mWifiService.isDualBandSupported()).thenReturn(true);
- assertTrue(mWifiManager.isDualBandSupported());
- verify(mWifiService).isDualBandSupported();
+ public void testIs5GHzBandSupported() throws Exception {
+ when(mWifiService.is5GHzBandSupported()).thenReturn(true);
+ assertTrue(mWifiManager.is5GHzBandSupported());
+ verify(mWifiService).is5GHzBandSupported();
+ }
+
+ /**
+ * Test behavior of {@link WifiManager#is6GHzBandSupported()}
+ */
+ @Test
+ public void testIs6GHzBandSupported() throws Exception {
+ when(mWifiService.is6GHzBandSupported()).thenReturn(true);
+ assertTrue(mWifiManager.is6GHzBandSupported());
+ verify(mWifiService).is6GHzBandSupported();
}
/**