CTS to verify local-only hotspot started at 2Ghz
The only exception is automotive builds which may start local-only
hotspot at 5Ghz
Bug:115666270
Test: run cts -m CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest#testStartLocalOnlyHotspotSuccess
Change-Id: Ic3df22dab4ee93b531b92e6ed38adfa2b75880c7
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 3b8ad6c..b09d458 100644
--- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java
@@ -408,6 +408,10 @@
return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION);
}
+ private boolean hasAutomotiveFeature() {
+ return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
+ }
+
/**
* test point of wifiManager NetWork:
* 1.add NetWork
@@ -847,6 +851,11 @@
// check if we got the callback
assertTrue(callback.onStartedCalled);
assertNotNull(callback.reservation.getWifiConfiguration());
+ if (!hasAutomotiveFeature()) {
+ assertEquals(
+ WifiConfiguration.AP_BAND_2GHZ,
+ callback.reservation.getWifiConfiguration().apBand);
+ }
assertFalse(callback.onFailedCalled);
assertFalse(callback.onStoppedCalled);
}