Merge "Fix transitioning between non-accept strict policies."

am: bef2c91bb5

Change-Id: Iacf9f43f88ac77cb2a6094348cf52107f7ef0817
This commit is contained in:
Lorenzo Colitti
2017-08-22 06:42:19 +00:00
committed by android-build-merger

View File

@@ -1838,12 +1838,14 @@ public class NetworkManagementService extends INetworkManagementService.Stub
// netd does not keep state on strict mode policies, and cannot replace a non-accept
// policy without deleting it first. Rather than add state to netd, just always send
// it an accept policy when switching between two non-accept policies.
// TODO: consider keeping state in netd so we can simplify this code.
if (oldPolicy != StrictMode.NETWORK_POLICY_ACCEPT &&
policy != StrictMode.NETWORK_POLICY_ACCEPT) {
applyUidCleartextNetworkPolicy(uid, policy);
applyUidCleartextNetworkPolicy(uid, StrictMode.NETWORK_POLICY_ACCEPT);
}
applyUidCleartextNetworkPolicy(uid, policy);
}
applyUidCleartextNetworkPolicy(uid, policy);
}
@Override