Update BatteryStats cpustats collection to be asynchronous.
- Collect cpu times info asynchronously when the screen state changes.
- Remove the redundant cpu collection during the battery state handling.
- Fix BatteryStatsNoteTest failing because of http://b/70808931
Bug: 70563832
Bug: 69054238
Test: atest hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
Test: atest core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: atest core/tests/coretests/src/com/android/internal/os/BstatsCpuTimesValidationTest.java
Change-Id: Ic6441d45f94dc0703b8adc03cb8d3ab5f877626d
6 files changed