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
This commit is contained in:
Pavel Maltsev
2018-10-05 10:49:48 -07:00
parent 9ac171651b
commit f99027bf27

View File

@@ -408,6 +408,10 @@ public class WifiManagerTest extends AndroidTestCase {
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 @@ public class WifiManagerTest extends AndroidTestCase {
// 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);
}