Merge "Retain subscription IDs on restricted test networks"
This commit is contained in:
@@ -1134,14 +1134,16 @@ public final class NetworkCapabilities implements Parcelable {
|
||||
mTransportTypes =
|
||||
(originalTransportTypes & UNRESTRICTED_TEST_NETWORKS_ALLOWED_TRANSPORTS)
|
||||
| (1 << TRANSPORT_TEST);
|
||||
|
||||
// SubIds are only allowed for Test Networks that only declare TRANSPORT_TEST.
|
||||
setSubscriptionIds(originalSubIds);
|
||||
} else {
|
||||
// If the test network is restricted, then it may declare any transport.
|
||||
mTransportTypes = (originalTransportTypes | (1 << TRANSPORT_TEST));
|
||||
}
|
||||
|
||||
if (hasSingleTransport(TRANSPORT_TEST)) {
|
||||
// SubIds are only allowed for Test Networks that only declare TRANSPORT_TEST.
|
||||
setSubscriptionIds(originalSubIds);
|
||||
}
|
||||
|
||||
mNetworkCapabilities = originalCapabilities & TEST_NETWORKS_ALLOWED_CAPABILITIES;
|
||||
if (!hasTransport(TRANSPORT_CELLULAR)) {
|
||||
mNetworkCapabilities |=
|
||||
|
||||
@@ -1387,6 +1387,9 @@ public class NetworkCapabilitiesTest {
|
||||
// If the test network is restricted, then the network may declare any transport, and
|
||||
// appended with TRANSPORT_TEST.
|
||||
expectedNcBuilder.addTransportType(TRANSPORT_CELLULAR);
|
||||
} else {
|
||||
// If the test network only has TRANSPORT_TEST, then it can keep the subscription IDs.
|
||||
expectedNcBuilder.setSubscriptionIds(Set.of(TEST_SUBID1));
|
||||
}
|
||||
expectedNcBuilder.addTransportType(TRANSPORT_TEST);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user