Merge "Add CTS for systemReady() & getIpSecNetIdRange()" am: 7e2a491835
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1676425 Change-Id: I6a26a8b344c367ce1b876ce67a443435f3de776a
This commit is contained in:
@@ -2151,6 +2151,24 @@ public class ConnectivityManagerTest {
|
|||||||
null /* listener */));
|
null /* listener */));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSystemReady() {
|
||||||
|
assumeTrue(TestUtils.shouldTestSApis());
|
||||||
|
assertThrows(SecurityException.class, () -> mCm.systemReady());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetIpSecNetIdRange() {
|
||||||
|
assumeTrue(TestUtils.shouldTestSApis());
|
||||||
|
// The lower refers to ConnectivityManager.TUN_INTF_NETID_START.
|
||||||
|
final long lower = 64512;
|
||||||
|
// The upper refers to ConnectivityManager.TUN_INTF_NETID_START
|
||||||
|
// + ConnectivityManager.TUN_INTF_NETID_RANGE - 1
|
||||||
|
final long upper = 65535;
|
||||||
|
assertEquals(lower, (long) ConnectivityManager.getIpSecNetIdRange().getLower());
|
||||||
|
assertEquals(upper, (long) ConnectivityManager.getIpSecNetIdRange().getUpper());
|
||||||
|
}
|
||||||
|
|
||||||
private void verifySettings(int expectedAirplaneMode, int expectedPrivateDnsMode,
|
private void verifySettings(int expectedAirplaneMode, int expectedPrivateDnsMode,
|
||||||
int expectedAvoidBadWifi) throws Exception {
|
int expectedAvoidBadWifi) throws Exception {
|
||||||
assertEquals(expectedAirplaneMode, Settings.Global.getInt(
|
assertEquals(expectedAirplaneMode, Settings.Global.getInt(
|
||||||
|
|||||||
Reference in New Issue
Block a user