Fix boot time race condition in BatteryStatsImpl
We need some services to create a battery stats snapshot
captured at the time of battery reset.
The issue is that if the battery stats reset occurs during boot,
before the system is ready, those services may not be prepared.
The fix is to postpone battery stats reset until after the
system server is ready.
Bug: 191120091
Test: run PowerOnOffTest#testPowerOnOff repeatedly
Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
(cherry picked from commit 77fc0fffe13fe04289831ac03ea9209421f969df)
3 files changed