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

Commit 3af0294c authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Update NPMS internal state when app idle parole state is changed.

Fixes: 37250313
Test: 1. cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests
      2. runtest -c com.android.server.NetworkPolicyManagerServiceTest frameworks-services
Change-Id: I5fcac397116a07fe9015b7dabf5bca57b0b23176
parent bf02434e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2992,7 +2992,12 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
                // Skip if it had no restrictions to begin with
                if ((oldRules & MASK_ALL_NETWORKS) == 0) continue;
            }
            updateRulesForPowerRestrictionsUL(uid, oldRules, paroled);
            final int newUidRules = updateRulesForPowerRestrictionsUL(uid, oldRules, paroled);
            if (newUidRules == RULE_NONE) {
                mUidRules.delete(uid);
            } else {
                mUidRules.put(uid, newUidRules);
            }
        }
    }