Never store battery stats for cache

In PowerUsageBase, it will store battery stats if it has a configuration
change, which will make BatteryStatsLoaderHelper never get the correct
battery stats because it uses Bundle.EMPTY as the bundle message.

This cl:
1. Remove the store action even though it is configuration change.
2. Always use null to get battery stats
3. Always start a battery status check in register()

Bug: 63658232
Test: RunSettingsRoboTests
Change-Id: Ifbf970c63378ed66dddcdae4d952b7d1fd84216a
This commit is contained in:
jackqdyulei
2017-07-14 15:23:32 -07:00
parent 8e1f509b5d
commit 114cf2a1a7
7 changed files with 101 additions and 32 deletions

View File

@@ -370,6 +370,7 @@ public class BatteryUtils {
public void initBatteryStatsHelper(BatteryStatsHelper statsHelper, Bundle bundle,
UserManager userManager) {
statsHelper.create(bundle);
statsHelper.clearStats();
statsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, userManager.getUserProfiles());
}