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

Commit 0a8540b3 authored by lesl's avatar lesl
Browse files

wifi: Add API to indicate (STA) + Bridged AP supported (Part 4)

AP+AP Part 4 includes:
1. Support API to indicate Bridged AP supported or not
2. Interface idx mechanism. I.e. STA+STA support, AP+AP will take wlan2 & wlan3

Bug: 162686273
Test: atest FrameworksWifiApiTests
Change-Id: Ic56700f58671ec3daaf05942eab06e0568465210
parent 30e1d45e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ package android.net.wifi {
    method public boolean is5GHzBandSupported();
    method public boolean is6GHzBandSupported();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isAutoWakeupEnabled();
    method public boolean isBridgedApConcurrencySupported();
    method @Deprecated public boolean isDeviceToApRttSupported();
    method public boolean isEasyConnectSupported();
    method public boolean isEnhancedOpenSupported();
@@ -341,6 +342,7 @@ package android.net.wifi {
    method @Deprecated public boolean isScanAlwaysAvailable();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isScanThrottleEnabled();
    method public boolean isStaApConcurrencySupported();
    method public boolean isStaBridgedApConcurrencySupported();
    method public boolean isTdlsSupported();
    method public boolean isWapiSupported();
    method public boolean isWifiEnabled();
+6 −0
Original line number Diff line number Diff line
@@ -926,6 +926,9 @@ public final class SoftApConfiguration implements Parcelable {
         * on the requested bands (if possible).
         * <p>
         *
         * Use {@link WifiManager#isBridgedApConcurrencySupported()} to determine
         * whether or not concurrent APs are supported.
         *
         * @param bands Array of the {@link #BandType}.
         * @return Builder for chaining.
         * @throws IllegalArgumentException when more than 2 bands are set or an invalid band type
@@ -998,6 +1001,9 @@ public final class SoftApConfiguration implements Parcelable {
         * The {@link SoftApCapability#getSupportedChannelList(int)} can be used to obtain
         * valid channels in each band.
         *
         * Use {@link WifiManager#isBridgedApConcurrencySupported()} to determine
         * whether or not concurrent APs are supported.
         *
         * <p>
         * If not set, the default for the channel is the special value 0 which has the framework
         * auto-select a valid channel from the band configured with {@link #setBands(int[])}.
+40 −0
Original line number Diff line number Diff line
@@ -2487,6 +2487,12 @@ public class WifiManager {
    /** @hide */
    public static final long WIFI_FEATURE_SAE_PK          = 0x10000000000L; // SAE-PK

    /** @hide */
    public static final long WIFI_FEATURE_STA_BRIDGED_AP       = 0x20000000000L; // STA + Bridged AP

    /** @hide */
    public static final long WIFI_FEATURE_BRIDGED_AP           = 0x40000000000L; // Bridged AP

    private long getSupportedFeatures() {
        try {
            return mService.getSupportedFeatures();
@@ -2686,6 +2692,40 @@ public class WifiManager {
        }
    }

    /**
     * Query whether the device supports Station (STA) + Bridged access point (AP)
     * concurrency or not.
     *
     * The bridged AP support means that the device supports AP + AP concurrency with the 2 APs
     * bridged together.
     *
     * See {@link SoftApConfiguration.Builder#setBands(int[])}
     * or {@link SoftApConfiguration.Builder#setChannels(SparseIntArray)} to configure bridged AP
     * when the bridged AP supported.
     *
     * @return true if this device supports STA + bridged AP concurrency, false otherwise.
     */
    public boolean isStaBridgedApConcurrencySupported() {
        return isFeatureSupported(WIFI_FEATURE_STA_BRIDGED_AP);
    }

    /**
     * Query whether the device supports Bridged Access point (AP) concurrency or not.
     *
     * The bridged AP support means that the device supports AP + AP concurrency with the 2 APs
     * bridged together.
     *
     * See {@link SoftApConfiguration.Builder#setBands(int[])}
     * or {@link SoftApConfiguration.Builder#setChannels(SparseIntArray)} to configure bridged AP
     * when the bridged AP supported.
     *
     * @return true if this device supports bridged AP concurrency, false otherwise.
     */
    public boolean isBridgedApConcurrencySupported() {
        return isFeatureSupported(WIFI_FEATURE_BRIDGED_AP);
    }


    /**
     * Interface for Wi-Fi activity energy info listener. Should be implemented by applications and
     * set when calling {@link WifiManager#getWifiActivityEnergyInfoAsync}.