Cleaned up dependency to data saver mode.

When power-save 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 the initial implementation left a lot
of dead code around; this change cleans up that code.

Changes:

- Renamed updateRulesForUidLocked() to
  updateRestrictDataRulesForUidLocked().
- Simplified updateRestrictDataRulesForUidLocked() implementation.
- Removed calls to updateRestrictDataRulesForUidLocked() from places
  that don't touch the data saver rules.
- Refactored the data saver part of updateRulesForGlobalChangeLocked()
  into a updateRulesForRestrictDataLocked(), which is similar to the
  existing methods for iddle and restricted power.
- Changed setRestrictBackground() to use
  updateRulesForRestrictDataLocked() instead of
  updateRulesForGlobalChangeLocked().
- Removed redundant calls to updateRestrictDataRulesForUidLocked() and
  updateRulesForGlobalChangeLocked() when an user id deleted.

BUG: 27127112
BUG: 26685616
Change-Id: I621d20139742cc0dd3bbf6fe9cbfe889ddcc1fd7
1 file changed