From 088588d3fb41d5dfb33d7d410bd10b7406180e96 Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Fri, 9 Mar 2018 20:52:15 +0900 Subject: [PATCH] Have the status bar listen to all macro-users VPN changes. Bug: 73217368 Test: manual Using Datally on work profile. Before this, enabling the VPN does not show the key icon. After this it does. Change-Id: I454eb8f3881a48af1b0187c2b14a2a399d3c2445 --- core/java/android/net/NetworkRequest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/java/android/net/NetworkRequest.java b/core/java/android/net/NetworkRequest.java index 96826f8000..1ee0ed7d90 100644 --- a/core/java/android/net/NetworkRequest.java +++ b/core/java/android/net/NetworkRequest.java @@ -23,6 +23,7 @@ import android.os.Process; import android.text.TextUtils; import java.util.Objects; +import java.util.Set; /** * Defines a request for a network, made through {@link NetworkRequest.Builder} and used @@ -203,6 +204,19 @@ public class NetworkRequest implements Parcelable { return this; } + /** + * Set the watched UIDs for this request. This will be reset and wiped out unless + * the calling app holds the CHANGE_NETWORK_STATE permission. + * + * @param uids The watched UIDs as a set of UidRanges, or null for everything. + * @return The builder to facilitate chaining. + * @hide + */ + public Builder setUids(Set uids) { + mNetworkCapabilities.setUids(uids); + return this; + } + /** * Add a capability that must not exist in the requested network. *