Transition BatteryAppListPreferences to BatteryUsageStats API

Bug: 173745486
Test: make RunSettingsRoboTests
Test: male RunSettingsGoogleRoboTests

Change-Id: I7af8cbcd27433b89cb2184750c6854aa74761d0d
This commit is contained in:
Dmitri Plotnikov
2021-03-08 20:11:54 -08:00
parent dba51aa233
commit 036dc189b6
13 changed files with 574 additions and 675 deletions

View File

@@ -50,7 +50,6 @@ public class PowerUsageAdvanced extends PowerUsageBase {
@VisibleForTesting
BatteryHistoryPreference mHistPref;
private BatteryUtils mBatteryUtils;
private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
private BatteryAppListPreferenceController mBatteryAppListPreferenceController;
@VisibleForTesting
@@ -64,7 +63,6 @@ public class PowerUsageAdvanced extends PowerUsageBase {
mHistPref = (BatteryHistoryPreference) findPreference(KEY_BATTERY_GRAPH);
mPowerUsageFeatureProvider = FeatureFactory.getFactory(context)
.getPowerUsageFeatureProvider(context);
mBatteryUtils = BatteryUtils.getInstance(context);
// init the summary so other preferences won't have unnecessary move
updateHistPrefSummary(context);
@@ -155,7 +153,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
updatePreference(mHistPref);
updateHistPrefSummary(context);
mBatteryAppListPreferenceController.refreshAppListGroup(mStatsHelper, mShowAllApps);
mBatteryAppListPreferenceController.refreshAppListGroup(mBatteryUsageStats, mShowAllApps);
}
private void updateHistPrefSummary(Context context) {