diff options
author | Kevin Cernekee <cernekee@google.com> | 2015-10-20 22:11:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-20 22:11:29 +0000 |
commit | 3554d62ca02bf6bc7777d1b22699876ec388fe6c (patch) | |
tree | 6f880dff9c3428ab234ea77f496d11da4a77db73 /services | |
parent | cf43b5523fd12fdc69ea25cb6dbf5e95724927ec (diff) | |
parent | 690f18a5648e292c29f17b248644e7b887c1f52c (diff) | |
download | frameworks_base-3554d62ca02bf6bc7777d1b22699876ec388fe6c.zip frameworks_base-3554d62ca02bf6bc7777d1b22699876ec388fe6c.tar.gz frameworks_base-3554d62ca02bf6bc7777d1b22699876ec388fe6c.tar.bz2 |
Merge "ignore initial request to disable iptable chain" into mnc-dr-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/NetworkManagementService.java | 6 | ||||
-rw-r--r-- | services/core/java/com/android/server/net/NetworkPolicyManagerService.java | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java index 433f707..ba9279c 100644 --- a/services/core/java/com/android/server/NetworkManagementService.java +++ b/services/core/java/com/android/server/NetworkManagementService.java @@ -2023,9 +2023,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub public void setFirewallChainEnabled(int chain, boolean enable) { enforceSystemUid(); synchronized (mQuotaLock) { - if (mFirewallChainStates.indexOfKey(chain) >= 0 && - mFirewallChainStates.get(chain) == enable) { - // All is the same, nothing to do. + if (mFirewallChainStates.get(chain, false) == enable) { + // All is the same, nothing to do. This relies on the fact that netd has child + // chains default detached. return; } mFirewallChainStates.put(chain, enable); diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index 88e86e7..bc8957f 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -2511,9 +2511,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { * Add or remove a uid to the firewall blacklist for all network ifaces. */ private void enableFirewallChainLocked(int chain, boolean enable) { - if (mFirewallChainStates.indexOfKey(chain) >= 0 && - mFirewallChainStates.get(chain) == enable) { - // All is the same, nothing to do. + if (mFirewallChainStates.get(chain, false) == enable) { + // All is the same, nothing to do. This relies on the fact that netd has child + // chains default detached. return; } mFirewallChainStates.put(chain, enable); |