Merge "Fix transitioning between non-accept strict policies." into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a68cdbe7b1
@@ -1838,13 +1838,15 @@ public class NetworkManagementService extends INetworkManagementService.Stub
|
|||||||
// netd does not keep state on strict mode policies, and cannot replace a non-accept
|
// 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
|
// 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.
|
// 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 &&
|
if (oldPolicy != StrictMode.NETWORK_POLICY_ACCEPT &&
|
||||||
policy != StrictMode.NETWORK_POLICY_ACCEPT) {
|
policy != StrictMode.NETWORK_POLICY_ACCEPT) {
|
||||||
|
applyUidCleartextNetworkPolicy(uid, StrictMode.NETWORK_POLICY_ACCEPT);
|
||||||
|
}
|
||||||
|
|
||||||
applyUidCleartextNetworkPolicy(uid, policy);
|
applyUidCleartextNetworkPolicy(uid, policy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
applyUidCleartextNetworkPolicy(uid, policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBandwidthControlEnabled() {
|
public boolean isBandwidthControlEnabled() {
|
||||||
|
|||||||
Reference in New Issue
Block a user