Save internal state to disk after updating whitelist revoked uids.
Fixes: 71817859
Test: manual
Change-Id: I555ec29ddf7821972556fda65faa3553a17244a1
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index 8febecf..ddb2a85 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -2338,7 +2338,7 @@
}
private void setUidPolicyUncheckedUL(int uid, int oldPolicy, int policy, boolean persist) {
- setUidPolicyUncheckedUL(uid, policy, persist);
+ setUidPolicyUncheckedUL(uid, policy, false);
final boolean notifyApp;
if (!isUidValidForWhitelistRules(uid)) {
@@ -2361,6 +2361,11 @@
}
mHandler.obtainMessage(MSG_POLICIES_CHANGED, uid, policy, Boolean.valueOf(notifyApp))
.sendToTarget();
+ if (persist) {
+ synchronized (mNetworkPoliciesSecondLock) {
+ writePolicyAL();
+ }
+ }
}
private void setUidPolicyUncheckedUL(int uid, int policy, boolean persist) {