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)
Loading
Please register or sign in to comment