Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31570,6 +31570,7 @@ package android.net.wifi { method public boolean isEasyConnectSupported(); method public boolean isEnhancedOpenSupported(); method public boolean isEnhancedPowerReportingSupported(); method public boolean isMultiStaConcurrencySupported(); method public boolean isP2pSupported(); method public boolean isPreferredNetworkOffloadSupported(); method @Deprecated public boolean isScanAlwaysAvailable(); wifi/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,7 @@ package android.net.wifi { method public boolean isEasyConnectSupported(); method public boolean isEnhancedOpenSupported(); method public boolean isEnhancedPowerReportingSupported(); method public boolean isMultiStaConcurrencySupported(); method public boolean isP2pSupported(); method public boolean isPreferredNetworkOffloadSupported(); method @Deprecated public boolean isScanAlwaysAvailable(); Loading wifi/java/android/net/wifi/WifiManager.java +13 −8 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.net.wifi.hotspot2.IProvisioningCallback; import android.net.wifi.hotspot2.OsuProvider; import android.net.wifi.hotspot2.PasspointConfiguration; import android.net.wifi.hotspot2.ProvisioningCallback; import android.net.wifi.util.SdkLevelUtil; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -2479,6 +2480,18 @@ public class WifiManager { return isFeatureSupported(WIFI_FEATURE_AP_STA); } /** * Query whether the device supports 2 or more concurrent stations (STA) or not. * * @return true if this device supports multiple STA concurrency, false otherwise. */ public boolean isMultiStaConcurrencySupported() { if (!SdkLevelUtil.isAtLeastS()) { throw new UnsupportedOperationException(); } return isFeatureSupported(WIFI_FEATURE_ADDITIONAL_STA); } /** * @deprecated Please use {@link android.content.pm.PackageManager#hasSystemFeature(String)} * with {@link android.content.pm.PackageManager#FEATURE_WIFI_RTT} and Loading Loading @@ -2511,14 +2524,6 @@ public class WifiManager { return isFeatureSupported(WIFI_FEATURE_PNO); } /** * @return true if this adapter supports multiple simultaneous connections * @hide */ public boolean isAdditionalStaSupported() { return isFeatureSupported(WIFI_FEATURE_ADDITIONAL_STA); } /** * @return true if this adapter supports Tunnel Directed Link Setup */ Loading wifi/tests/src/android/net/wifi/WifiManagerTest.java +32 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import static android.net.wifi.WifiManager.STATUS_SUGGESTION_CONNECTION_FAILURE_ import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLING; import static android.net.wifi.WifiManager.WIFI_AP_STATE_FAILED; import static android.net.wifi.WifiManager.WIFI_FEATURE_ADDITIONAL_STA; import static android.net.wifi.WifiManager.WIFI_FEATURE_AP_STA; import static android.net.wifi.WifiManager.WIFI_FEATURE_DPP; import static android.net.wifi.WifiManager.WIFI_FEATURE_OWE; import static android.net.wifi.WifiManager.WIFI_FEATURE_P2P; Loading @@ -49,6 +51,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.any; Loading Loading @@ -83,6 +86,7 @@ import android.net.wifi.WifiManager.SoftApCallback; import android.net.wifi.WifiManager.SuggestionConnectionStatusListener; import android.net.wifi.WifiManager.TrafficStateCallback; import android.net.wifi.WifiManager.WifiConnectedNetworkScorer; import android.net.wifi.util.SdkLevelUtil; import android.os.Build; import android.os.Handler; import android.os.HandlerExecutor; Loading Loading @@ -1707,6 +1711,34 @@ public class WifiManagerTest { assertFalse(mWifiManager.isEasyConnectSupported()); } /** * Test behavior of isStaApConcurrencySupported */ @Test public void testIsStaApConcurrencyOpenSupported() throws Exception { when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(WIFI_FEATURE_AP_STA)); assertTrue(mWifiManager.isStaApConcurrencySupported()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(~WIFI_FEATURE_AP_STA)); assertFalse(mWifiManager.isStaApConcurrencySupported()); } /** * Test behavior of isMultiStaConcurrencySupported */ @Test public void testIsMultiStaConcurrencyOpenSupported() throws Exception { assumeTrue(SdkLevelUtil.isAtLeastS()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(WIFI_FEATURE_ADDITIONAL_STA)); assertTrue(mWifiManager.isMultiStaConcurrencySupported()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(~WIFI_FEATURE_ADDITIONAL_STA)); assertFalse(mWifiManager.isMultiStaConcurrencySupported()); } /** * Test behavior of {@link WifiManager#addNetwork(WifiConfiguration)} */ Loading Loading @@ -1858,7 +1890,6 @@ public class WifiManagerTest { assertFalse(mWifiManager.isDeviceToDeviceRttSupported()); assertFalse(mWifiManager.isDeviceToApRttSupported()); assertFalse(mWifiManager.isPreferredNetworkOffloadSupported()); assertFalse(mWifiManager.isAdditionalStaSupported()); assertFalse(mWifiManager.isTdlsSupported()); assertFalse(mWifiManager.isOffChannelTdlsSupported()); assertFalse(mWifiManager.isEnhancedPowerReportingSupported()); Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31570,6 +31570,7 @@ package android.net.wifi { method public boolean isEasyConnectSupported(); method public boolean isEnhancedOpenSupported(); method public boolean isEnhancedPowerReportingSupported(); method public boolean isMultiStaConcurrencySupported(); method public boolean isP2pSupported(); method public boolean isPreferredNetworkOffloadSupported(); method @Deprecated public boolean isScanAlwaysAvailable();
wifi/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,7 @@ package android.net.wifi { method public boolean isEasyConnectSupported(); method public boolean isEnhancedOpenSupported(); method public boolean isEnhancedPowerReportingSupported(); method public boolean isMultiStaConcurrencySupported(); method public boolean isP2pSupported(); method public boolean isPreferredNetworkOffloadSupported(); method @Deprecated public boolean isScanAlwaysAvailable(); Loading
wifi/java/android/net/wifi/WifiManager.java +13 −8 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.net.wifi.hotspot2.IProvisioningCallback; import android.net.wifi.hotspot2.OsuProvider; import android.net.wifi.hotspot2.PasspointConfiguration; import android.net.wifi.hotspot2.ProvisioningCallback; import android.net.wifi.util.SdkLevelUtil; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -2479,6 +2480,18 @@ public class WifiManager { return isFeatureSupported(WIFI_FEATURE_AP_STA); } /** * Query whether the device supports 2 or more concurrent stations (STA) or not. * * @return true if this device supports multiple STA concurrency, false otherwise. */ public boolean isMultiStaConcurrencySupported() { if (!SdkLevelUtil.isAtLeastS()) { throw new UnsupportedOperationException(); } return isFeatureSupported(WIFI_FEATURE_ADDITIONAL_STA); } /** * @deprecated Please use {@link android.content.pm.PackageManager#hasSystemFeature(String)} * with {@link android.content.pm.PackageManager#FEATURE_WIFI_RTT} and Loading Loading @@ -2511,14 +2524,6 @@ public class WifiManager { return isFeatureSupported(WIFI_FEATURE_PNO); } /** * @return true if this adapter supports multiple simultaneous connections * @hide */ public boolean isAdditionalStaSupported() { return isFeatureSupported(WIFI_FEATURE_ADDITIONAL_STA); } /** * @return true if this adapter supports Tunnel Directed Link Setup */ Loading
wifi/tests/src/android/net/wifi/WifiManagerTest.java +32 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import static android.net.wifi.WifiManager.STATUS_SUGGESTION_CONNECTION_FAILURE_ import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLING; import static android.net.wifi.WifiManager.WIFI_AP_STATE_FAILED; import static android.net.wifi.WifiManager.WIFI_FEATURE_ADDITIONAL_STA; import static android.net.wifi.WifiManager.WIFI_FEATURE_AP_STA; import static android.net.wifi.WifiManager.WIFI_FEATURE_DPP; import static android.net.wifi.WifiManager.WIFI_FEATURE_OWE; import static android.net.wifi.WifiManager.WIFI_FEATURE_P2P; Loading @@ -49,6 +51,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.any; Loading Loading @@ -83,6 +86,7 @@ import android.net.wifi.WifiManager.SoftApCallback; import android.net.wifi.WifiManager.SuggestionConnectionStatusListener; import android.net.wifi.WifiManager.TrafficStateCallback; import android.net.wifi.WifiManager.WifiConnectedNetworkScorer; import android.net.wifi.util.SdkLevelUtil; import android.os.Build; import android.os.Handler; import android.os.HandlerExecutor; Loading Loading @@ -1707,6 +1711,34 @@ public class WifiManagerTest { assertFalse(mWifiManager.isEasyConnectSupported()); } /** * Test behavior of isStaApConcurrencySupported */ @Test public void testIsStaApConcurrencyOpenSupported() throws Exception { when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(WIFI_FEATURE_AP_STA)); assertTrue(mWifiManager.isStaApConcurrencySupported()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(~WIFI_FEATURE_AP_STA)); assertFalse(mWifiManager.isStaApConcurrencySupported()); } /** * Test behavior of isMultiStaConcurrencySupported */ @Test public void testIsMultiStaConcurrencyOpenSupported() throws Exception { assumeTrue(SdkLevelUtil.isAtLeastS()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(WIFI_FEATURE_ADDITIONAL_STA)); assertTrue(mWifiManager.isMultiStaConcurrencySupported()); when(mWifiService.getSupportedFeatures()) .thenReturn(new Long(~WIFI_FEATURE_ADDITIONAL_STA)); assertFalse(mWifiManager.isMultiStaConcurrencySupported()); } /** * Test behavior of {@link WifiManager#addNetwork(WifiConfiguration)} */ Loading Loading @@ -1858,7 +1890,6 @@ public class WifiManagerTest { assertFalse(mWifiManager.isDeviceToDeviceRttSupported()); assertFalse(mWifiManager.isDeviceToApRttSupported()); assertFalse(mWifiManager.isPreferredNetworkOffloadSupported()); assertFalse(mWifiManager.isAdditionalStaSupported()); assertFalse(mWifiManager.isTdlsSupported()); assertFalse(mWifiManager.isOffChannelTdlsSupported()); assertFalse(mWifiManager.isEnhancedPowerReportingSupported()); Loading