Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a68cdbe7 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Fix transitioning between non-accept strict policies." into oc-mr1-dev

parents 9b601f20 7a2b13ea
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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
            // 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);
        }
    }

    @Override
    public boolean isBandwidthControlEnabled() {