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

Skip to content
Commit f28983d3 authored by Felipe Leme's avatar Felipe Leme
Browse files

More Data Saver / Battery Saver modes cleanup

When Battery Saver mode was first implemented, there were no firewall rules
on netd, so the solution was to make all network interface metered and
re-use the bw_penalty_box chain.

Recently, a fw_powersave chain was created with the purpose of
separating these 2 concerns, but some scenarios were no properly
handled.

This change further cleans up the code by:

- Creating a updateRestrictionRulesForUidLocked() to be used when both
  Battery Saver and Power Save rules need to be re-evaluated.
- Renaming some methods to be more consistent with others.
- Disabling rules for apps that do not have internet permissions.
- Updating network stats only when process status changes.
- Only updating Battery Saver rules when they changed.

BUG: 27127112
BUG: 26685616

Change-Id: I75fbc9733b8989fadcb10ebc154e214e3d256fe9
parent 1f6bdbca
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