From db77edac1c76c9ccb1e7d9a07b71332174c020c2 Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Fri, 16 Jun 2017 17:21:59 -0700 Subject: [PATCH] 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 --- .../src/android/net/wifi/cts/WifiManagerTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 cbf3e93e1d..7753c63078 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 @@ public class WifiManagerTest extends AndroidTestCase { * 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 @@ public class WifiManagerTest extends AndroidTestCase { * 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 @@ public class WifiManagerTest extends AndroidTestCase { * 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();