Let network requests see VPNs.

Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3b16caad7787c3c1f2921ca1583815c89efbadc5
This commit is contained in:
Chalard Jean
2018-01-10 21:19:32 +09:00
parent 3a6b34c989
commit fd3a4ae0fe
3 changed files with 48 additions and 7 deletions

View File

@@ -894,6 +894,17 @@ public final class NetworkCapabilities implements Parcelable {
*/
private Set<UidRange> mUids = null;
/**
* Convenience method to set the UIDs this network applies to to a single UID.
* @hide
*/
public NetworkCapabilities setSingleUid(int uid) {
final ArraySet<UidRange> identity = new ArraySet<>(1);
identity.add(new UidRange(uid, uid));
setUids(identity);
return this;
}
/**
* Set the list of UIDs this network applies to.
* This makes a copy of the set so that callers can't modify it after the call.