Allow tests to create TRANSPORT_TEST|TRANSPORT_VPN networks. am: f3963fa279
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511312 Change-Id: Id28ea9f3b72e5cae0232ffc7698120512359be49
This commit is contained in:
@@ -712,6 +712,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
if (ArrayUtils.contains(originalAdministratorUids, creatorUid)) {
|
if (ArrayUtils.contains(originalAdministratorUids, creatorUid)) {
|
||||||
setAdministratorUids(new int[] {creatorUid});
|
setAdministratorUids(new int[] {creatorUid});
|
||||||
}
|
}
|
||||||
|
// There is no need to clear the UIDs, they have already been cleared by clearAll() above.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -805,7 +806,9 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private static final int TEST_NETWORKS_ALLOWED_TRANSPORTS = 1 << TRANSPORT_TEST
|
private static final int TEST_NETWORKS_ALLOWED_TRANSPORTS = 1 << TRANSPORT_TEST
|
||||||
// Test ethernet networks can be created with EthernetManager#setIncludeTestInterfaces
|
// Test ethernet networks can be created with EthernetManager#setIncludeTestInterfaces
|
||||||
| 1 << TRANSPORT_ETHERNET;
|
| 1 << TRANSPORT_ETHERNET
|
||||||
|
// Test VPN networks can be created but their UID ranges must be empty.
|
||||||
|
| 1 << TRANSPORT_VPN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the given transport type to this {@code NetworkCapability} instance.
|
* Adds the given transport type to this {@code NetworkCapability} instance.
|
||||||
|
|||||||
Reference in New Issue
Block a user