Merge "Fix cannot find removeUnwantedCapability on R device" am: 3ef6584f1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649302 Change-Id: I11ee0a8d6388f78a9db90756c0cbee93c923e1b8
This commit is contained in:
@@ -612,17 +612,18 @@ public class NetworkCapabilitiesTest {
|
|||||||
// From S, it is not allowed to have the same capability in both wanted and
|
// From S, it is not allowed to have the same capability in both wanted and
|
||||||
// unwanted list.
|
// unwanted list.
|
||||||
assertThrows(IllegalArgumentException.class, () -> nc2.combineCapabilities(nc1));
|
assertThrows(IllegalArgumentException.class, () -> nc2.combineCapabilities(nc1));
|
||||||
|
// Remove unwanted capability to continue other tests.
|
||||||
|
nc1.removeUnwantedCapability(NET_CAPABILITY_NOT_ROAMING);
|
||||||
} else {
|
} else {
|
||||||
nc2.combineCapabilities(nc1);
|
nc2.combineCapabilities(nc1);
|
||||||
// We will get this capability in both requested and unwanted lists thus this request
|
// We will get this capability in both requested and unwanted lists thus this request
|
||||||
// will never be satisfied.
|
// will never be satisfied.
|
||||||
assertTrue(nc2.hasCapability(NET_CAPABILITY_NOT_ROAMING));
|
assertTrue(nc2.hasCapability(NET_CAPABILITY_NOT_ROAMING));
|
||||||
assertTrue(nc2.hasUnwantedCapability(NET_CAPABILITY_NOT_ROAMING));
|
assertTrue(nc2.hasUnwantedCapability(NET_CAPABILITY_NOT_ROAMING));
|
||||||
|
// For R or below, remove unwanted capability via removeCapability.
|
||||||
|
nc1.removeCapability(NET_CAPABILITY_NOT_ROAMING);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove unwanted capability to continue other tests.
|
|
||||||
nc1.removeUnwantedCapability(NET_CAPABILITY_NOT_ROAMING);
|
|
||||||
|
|
||||||
nc1.setSSID(TEST_SSID);
|
nc1.setSSID(TEST_SSID);
|
||||||
nc2.combineCapabilities(nc1);
|
nc2.combineCapabilities(nc1);
|
||||||
if (isAtLeastR()) {
|
if (isAtLeastR()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user