Skip to content
Commit d8ed268a authored by Aaron Huang's avatar Aaron Huang
Browse files

Have NetworkPolicyManagerService listen onLinkPropertiesChanged callback

In current design, NPMS listens onThresholdReached() callback to
call updateNetworkRulesNL(), however, this callback will not be
called if data usage is not updated. Thus, it will cause to no
iptables rule for new metered interfaces.

Have NPMS listen onLinkProperitesChanged() callback and call
updateNetworkRulesNL() if interfaces has changed to add iptables
rules for new metered interfaces.

Bug: 225971066
Test: HostsideRestrictBackgroundNetworkTests
      HostsideRestrictBackgroundNetworkTests# \
      testDataAndBatterySaverModes_meteredNetwork \
      --iterations 100
Change-Id: I49f999efc3fbe0a6a325ec138a3f060c7285e6ad
Merged-In: I49f999efc3fbe0a6a325ec138a3f060c7285e6ad
(cherry picked from commit 7fe4e5d9)
parent f69119a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment