diff options
author | Junyu Lai <junyulai@google.com> | 2021-03-23 12:16:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-23 12:16:18 +0000 |
commit | 5b477acbbe8bc17d3ab8dd6c8238d2fbd699a945 (patch) | |
tree | 0cbbe9fb7ccd0f9b6064099ea24cbb90401a52f6 /tests | |
parent | 457f91decf3b707dfe295ca51484d4ccd73aacac (diff) | |
parent | c9afd3fa08008934343277762d7617e8d1a5c95b (diff) |
Merge "Fix cannot find removeUnwantedCapability on R device"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/net/common/java/android/net/NetworkCapabilitiesTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/net/common/java/android/net/NetworkCapabilitiesTest.java b/tests/net/common/java/android/net/NetworkCapabilitiesTest.java index d3c3cfda147d..1f50e31cf243 100644 --- a/tests/net/common/java/android/net/NetworkCapabilitiesTest.java +++ b/tests/net/common/java/android/net/NetworkCapabilitiesTest.java @@ -612,17 +612,18 @@ public class NetworkCapabilitiesTest { // From S, it is not allowed to have the same capability in both wanted and // unwanted list. assertThrows(IllegalArgumentException.class, () -> nc2.combineCapabilities(nc1)); + // Remove unwanted capability to continue other tests. + nc1.removeUnwantedCapability(NET_CAPABILITY_NOT_ROAMING); } else { nc2.combineCapabilities(nc1); // We will get this capability in both requested and unwanted lists thus this request // will never be satisfied. assertTrue(nc2.hasCapability(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); nc2.combineCapabilities(nc1); if (isAtLeastR()) { |