From 0a8540b3e354764a8eb05d0cc0b4bf76a6bca1ae Mon Sep 17 00:00:00 2001 From: lesl Date: Fri, 27 Nov 2020 13:05:04 +0800 Subject: [PATCH] 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 --- wifi/api/current.txt | 2 + .../android/net/wifi/SoftApConfiguration.java | 6 +++ wifi/java/android/net/wifi/WifiManager.java | 40 +++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/wifi/api/current.txt b/wifi/api/current.txt index 911f2fbc6afa0..c6cef292bdf23 100644 --- a/wifi/api/current.txt +++ b/wifi/api/current.txt @@ -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(); diff --git a/wifi/java/android/net/wifi/SoftApConfiguration.java b/wifi/java/android/net/wifi/SoftApConfiguration.java index 9f9d7f3c3051e..57c1abafdbdb7 100644 --- a/wifi/java/android/net/wifi/SoftApConfiguration.java +++ b/wifi/java/android/net/wifi/SoftApConfiguration.java @@ -926,6 +926,9 @@ public final class SoftApConfiguration implements Parcelable { * on the requested bands (if possible). *

* + * 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. + * *

* 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[])}. diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index da7c9c055d659..09d04c9203f1f 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -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}.