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

Commit 4f71df40 authored by Ahmed ElArabawy's avatar Ahmed ElArabawy Committed by Android (Google) Code Review
Browse files

Merge "Wifi: Add a public API to query for supported wifi standards"

parents 2db1d20e 9b3f0765
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30774,6 +30774,7 @@ package android.net.wifi {
    method public boolean isTdlsSupported();
    method public boolean isWapiSupported();
    method public boolean isWifiEnabled();
    method public boolean isWifiStandardSupported(int);
    method public boolean isWpa3SaeSupported();
    method public boolean isWpa3SuiteBSupported();
    method @Deprecated public boolean pingSupplicant();
+2 −0
Original line number Diff line number Diff line
@@ -117,6 +117,8 @@ interface IWifiManager

    boolean is6GHzBandSupported();

    boolean isWifiStandardSupported(int standard);

    boolean needs5GHzToAnyApBandConversion();

    DhcpInfo getDhcpInfo();
+14 −0
Original line number Diff line number Diff line
@@ -2490,6 +2490,20 @@ public class WifiManager {
        }
    }

    /**
     * Check if the chipset supports a certain Wi-Fi standard.
     * @param standard the IEEE 802.11 standard to check on.
     *        valid values from {@link ScanResult}'s {@code WIFI_STANDARD_}
     * @return {@code true} if supported, {@code false} otherwise.
     */
    public boolean isWifiStandardSupported(@ScanResult.WifiStandard int standard) {
        try {
            return mService.isWifiStandardSupported(standard);
        } 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}.
+5 −0
Original line number Diff line number Diff line
@@ -253,6 +253,11 @@ public class BaseWifiService extends IWifiManager.Stub {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean isWifiStandardSupported(int standard) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean needs5GHzToAnyApBandConversion() {
        throw new UnsupportedOperationException();
+11 −0
Original line number Diff line number Diff line
@@ -1958,6 +1958,17 @@ public class WifiManagerTest {
        verify(mWifiService).is6GHzBandSupported();
    }

    /**
     * Test behavior of {@link WifiManager#isWifiStandardSupported()}
     */
    @Test
    public void testIsWifiStandardSupported() throws Exception {
        int standard = ScanResult.WIFI_STANDARD_11AX;
        when(mWifiService.isWifiStandardSupported(standard)).thenReturn(true);
        assertTrue(mWifiManager.isWifiStandardSupported(standard));
        verify(mWifiService).isWifiStandardSupported(standard);
    }

    /**
     * Test behavior of {@link WifiManager#getDhcpInfo()}
     */