Add app usage preferencee item into the history preference
Bug: 177406865 Test: make SettingsRoboTests Test: make SettingsGoogleRoboTests Change-Id: I7d9a14eca0b8d3b054e040cb13135ef15390e512
This commit is contained in:
@@ -57,6 +57,7 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
final BatteryHistoryLoaderCallbacks mBatteryHistoryLoaderCallbacks =
|
||||
new BatteryHistoryLoaderCallbacks();
|
||||
|
||||
private boolean mIsChartDataLoaded = false;
|
||||
private boolean mIsChartGraphEnabled = false;
|
||||
private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
|
||||
private BatteryChartPreferenceController mBatteryChartPreferenceController;
|
||||
@@ -145,10 +146,11 @@ public class PowerUsageAdvanced extends PowerUsageBase {
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putInt(KEY_REFRESH_TYPE, refreshType);
|
||||
// Uses customized battery history loader if chart design is enabled.
|
||||
if (mIsChartGraphEnabled) {
|
||||
if (mIsChartGraphEnabled && !mIsChartDataLoaded) {
|
||||
mIsChartDataLoaded = true;
|
||||
getLoaderManager().restartLoader(LOADER_BATTERY_USAGE_STATS, bundle,
|
||||
mBatteryHistoryLoaderCallbacks);
|
||||
} else {
|
||||
mBatteryHistoryLoaderCallbacks);
|
||||
} else if (!mIsChartGraphEnabled) {
|
||||
super.restartBatteryStatsLoader(refreshType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user