summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/net/NetworkPolicyManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java
index 13ece40..e9d65e6 100644
--- a/core/java/android/net/NetworkPolicyManager.java
+++ b/core/java/android/net/NetworkPolicyManager.java
@@ -168,6 +168,15 @@ public class NetworkPolicyManager {
time.normalize(true);
}
+ /**
+ * Check if given UID can have a {@link #setUidPolicy(int, int)} defined,
+ * usually to protect critical system services.
+ */
+ public static boolean isUidValidForPolicy(Context context, int uid) {
+ return (uid >= android.os.Process.FIRST_APPLICATION_UID
+ && uid <= android.os.Process.LAST_APPLICATION_UID);
+ }
+
/** {@hide} */
public static void dumpPolicy(PrintWriter fout, int policy) {
fout.write("[");