Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c67d4f75 authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

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
parent eb630065
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
+11 −0
Original line number Diff line number Diff line
@@ -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
     */
@@ -2278,6 +2281,14 @@ public class WifiManager {
        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
+1 −0
Original line number Diff line number Diff line
@@ -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());