Merge "ignore initial request to disable iptable chain" into mnc-dr-dev

am: 3554d62ca0

* commit '3554d62ca02bf6bc7777d1b22699876ec388fe6c':
  ignore initial request to disable iptable chain
This commit is contained in:
Kevin Cernekee
2015-10-20 22:18:22 +00:00
committed by android-build-merger
2 changed files with 6 additions and 6 deletions

View File

@@ -2023,9 +2023,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub
public void setFirewallChainEnabled(int chain, boolean enable) { public void setFirewallChainEnabled(int chain, boolean enable) {
enforceSystemUid(); enforceSystemUid();
synchronized (mQuotaLock) { synchronized (mQuotaLock) {
if (mFirewallChainStates.indexOfKey(chain) >= 0 && if (mFirewallChainStates.get(chain, false) == enable) {
mFirewallChainStates.get(chain) == enable) { // All is the same, nothing to do. This relies on the fact that netd has child
// All is the same, nothing to do. // chains default detached.
return; return;
} }
mFirewallChainStates.put(chain, enable); mFirewallChainStates.put(chain, enable);

View File

@@ -2598,9 +2598,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
* Add or remove a uid to the firewall blacklist for all network ifaces. * Add or remove a uid to the firewall blacklist for all network ifaces.
*/ */
private void enableFirewallChainLocked(int chain, boolean enable) { private void enableFirewallChainLocked(int chain, boolean enable) {
if (mFirewallChainStates.indexOfKey(chain) >= 0 && if (mFirewallChainStates.get(chain, false) == enable) {
mFirewallChainStates.get(chain) == enable) { // All is the same, nothing to do. This relies on the fact that netd has child
// All is the same, nothing to do. // chains default detached.
return; return;
} }
mFirewallChainStates.put(chain, enable); mFirewallChainStates.put(chain, enable);