Tron counters for battery saving stats.

It adds 4 sets of the following two counters:
- battery_saver_stats_seconds_XY
  Time spent in the current mode, in seconds.
- battery_saver_stats_milliamps_XY
  Battery spent in the current mode, in mA.

Where
  X = "1":battery saver ON or "0": battery saver OFF.
  Y = "1":device interactive or "0": device not interactive.

Which are sent when either of the above states is about to change.

For example, when the user turns on the screen, and turns it off in 60 seconds,
and the battery level dropped 1mA during this (w/ assuming battery saver OFF),
we'd send the following two values:

- battery_saver_stats_seconds_01    = 60
- battery_saver_stats_milliamps_01  = 1

Bug: 72229630
Test: manual test with dumpsys power, etc
Test:  atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/BatterySavingStatsTest.java
Change-Id: I8ab8c395ca17b64638b2b164211528ac74e49023
2 files changed