diff options
author | Jeff Sharkey <jsharkey@google.com> | 2015-10-12 16:34:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-12 16:34:19 +0000 |
commit | a03ecf7d7c8ff2844caf5feecc6d29f1f7346ff9 (patch) | |
tree | 50732b4692fc84d2f1b37bfd87b5bb5b582dc405 /core | |
parent | fe45f1b97a1f572ce453193035f1fabf7957cc03 (diff) | |
parent | dc988061ac145c86d6871e249d65ca326aaff99f (diff) | |
download | frameworks_base-a03ecf7d7c8ff2844caf5feecc6d29f1f7346ff9.zip frameworks_base-a03ecf7d7c8ff2844caf5feecc6d29f1f7346ff9.tar.gz frameworks_base-a03ecf7d7c8ff2844caf5feecc6d29f1f7346ff9.tar.bz2 |
Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/net/NetworkPolicyManager.java | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java index 3f40484..a83e722 100644 --- a/core/java/android/net/NetworkPolicyManager.java +++ b/core/java/android/net/NetworkPolicyManager.java @@ -50,12 +50,13 @@ public class NetworkPolicyManager { public static final int POLICY_ALLOW_BACKGROUND_BATTERY_SAVE = 0x2; /* RULE_* are not masks and they must be exclusive */ + public static final int RULE_UNKNOWN = -1; /** All network traffic should be allowed. */ - public static final int RULE_ALLOW_ALL = 0x0; + public static final int RULE_ALLOW_ALL = 0; /** Reject traffic on metered networks. */ - public static final int RULE_REJECT_METERED = 0x1; + public static final int RULE_REJECT_METERED = 1; /** Reject traffic on all networks. */ - public static final int RULE_REJECT_ALL = 0x2; + public static final int RULE_REJECT_ALL = 2; public static final int FIREWALL_RULE_DEFAULT = 0; public static final int FIREWALL_RULE_ALLOW = 1; @@ -326,25 +327,4 @@ public class NetworkPolicyManager { // nothing found above; we can apply policy to UID return true; } - - /** {@hide} */ - public static void dumpPolicy(PrintWriter fout, int policy) { - fout.write("["); - if ((policy & POLICY_REJECT_METERED_BACKGROUND) != 0) { - fout.write("REJECT_METERED_BACKGROUND"); - } - fout.write("]"); - } - - /** {@hide} */ - public static void dumpRules(PrintWriter fout, int rules) { - fout.write("["); - if ((rules & RULE_REJECT_METERED) != 0) { - fout.write("REJECT_METERED"); - } else if ((rules & RULE_REJECT_ALL) != 0) { - fout.write("REJECT_ALL"); - } - fout.write("]"); - } - } |