WifiManagerTest: check softap mode supported
When running the LocalOnlyHotspot tests, first check if
isPortableHotspotSupported is true.
Bug: 62343300
Test: cts-tradefed run cts-dev --module CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest
Change-Id: Ie36435c3eb5b41ada4b64a3e7452b006da41b00c
diff --git a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java
index cbf3e93..7753c63 100644
--- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java
@@ -788,6 +788,11 @@
* Note: Location mode must be enabled for this test.
*/
public void testStartLocalOnlyHotspotSuccess() {
+ // first check that softap mode is supported by the device
+ if (!mWifiManager.isPortableHotspotSupported()) {
+ return;
+ }
+
boolean wifiEnabled = mWifiManager.isWifiEnabled();
TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
@@ -808,6 +813,11 @@
* Note: Location mode must be enabled for this test.
*/
public void testSetWifiEnabledByAppDoesNotStopHotspot() {
+ // first check that softap mode is supported by the device
+ if (!mWifiManager.isPortableHotspotSupported()) {
+ return;
+ }
+
boolean wifiEnabled = mWifiManager.isWifiEnabled();
TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
@@ -827,6 +837,11 @@
* Note: Location mode must be enabled for this test.
*/
public void testStartLocalOnlyHotspotSingleRequestByApps() {
+ // first check that softap mode is supported by the device
+ if (!mWifiManager.isPortableHotspotSupported()) {
+ return;
+ }
+
boolean caughtException = false;
boolean wifiEnabled = mWifiManager.isWifiEnabled();