diff options
author | Xiaohui Chen <xiaohuic@google.com> | 2015-06-26 16:20:48 -0700 |
---|---|---|
committer | Xiaohui Chen <xiaohuic@google.com> | 2015-06-26 16:31:43 -0700 |
commit | c915eebbf8782f64c5d7167a72c4c4f1d35f6e83 (patch) | |
tree | 9d33c1dd81318e5a6e990916b2e96fbff1d5d805 | |
parent | 1c3b7a6de6593c8a1c01ce48e04dda7e11471288 (diff) | |
download | frameworks_base-c915eebbf8782f64c5d7167a72c4c4f1d35f6e83.zip frameworks_base-c915eebbf8782f64c5d7167a72c4c4f1d35f6e83.tar.gz frameworks_base-c915eebbf8782f64c5d7167a72c4c4f1d35f6e83.tar.bz2 |
fix temp white list update in device idle
It appears firewall rules for temp white list is updated differently
from the non temp one. The non temp one will trigger a global update
but the temp one is updating only the uids in the list one by one.
The individual uid firewall rule update does not work well with dozable
chain. This cl moves the dozable chain update logic out and put it where
the white list is updated.
BUG:22094135
Change-Id: I425c82da6231b1ef119664907705d0880365f339
-rw-r--r-- | services/core/java/com/android/server/net/NetworkPolicyManagerService.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index 847bcb5..d4b7256 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -2093,8 +2093,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { for (UserInfo user : users) { for (int i = mPowerSaveTempWhitelistAppIds.size() - 1; i >= 0; i--) { int appId = mPowerSaveTempWhitelistAppIds.keyAt(i); + boolean isAllow = mPowerSaveTempWhitelistAppIds.valueAt(i); int uid = UserHandle.getUid(user.id, appId); updateRulesForUidLocked(uid); + setUidFirewallRule(FIREWALL_CHAIN_DOZABLE, uid, !isAllow); } } } @@ -2190,11 +2192,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final boolean firewallReject = (uidRules & RULE_REJECT_ALL) != 0; if (oldFirewallReject != firewallReject) { setUidFirewallRule(FIREWALL_CHAIN_STANDBY, uid, firewallReject); - if (mFirewallChainStates.get(FIREWALL_CHAIN_DOZABLE) && !firewallReject) { - // if the dozable chain is on, and we decide to allow this uid. we need to punch - // a hole in the dozable chain. - setUidFirewallRule(FIREWALL_CHAIN_DOZABLE, uid, false); - } } // dispatch changed rule to existing listeners |