Clean up unused function getHideApplicationSummary in
PowerUsageFeatureProvider. Bug: 253395332 Bug: 254769892 Bug: 254769770 Test: make RunSettingsRoboTests Change-Id: I6acf0cbdb7321934e85939e0acee567001107a17
This commit is contained in:
@@ -119,7 +119,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
private final String mPreferenceKey;
|
||||
private final SettingsActivity mActivity;
|
||||
private final InstrumentedPreferenceFragment mFragment;
|
||||
private final CharSequence[] mNotAllowShowSummaryPackages;
|
||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final AnimatorListenerAdapter mHourlyChartFadeInAdapter =
|
||||
@@ -149,10 +148,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
mIs24HourFormat = DateFormat.is24HourFormat(context);
|
||||
mMetricsFeatureProvider =
|
||||
FeatureFactory.getFactory(mContext).getMetricsFeatureProvider();
|
||||
mNotAllowShowSummaryPackages =
|
||||
FeatureFactory.getFactory(context)
|
||||
.getPowerUsageFeatureProvider(context)
|
||||
.getHideApplicationSummary(context);
|
||||
if (lifecycle != null) {
|
||||
lifecycle.addObserver(this);
|
||||
}
|
||||
@@ -257,8 +252,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
Log.d(TAG, String.format("handleClick() label=%s key=%s package=%s",
|
||||
diffEntry.getAppLabel(), histEntry.getKey(), histEntry.mPackageName));
|
||||
AdvancedPowerUsageDetail.startBatteryDetailPage(
|
||||
mActivity, mFragment, diffEntry, powerPref.getPercent(),
|
||||
isValidToShowSummary(packageName), getSlotInformation());
|
||||
mActivity, mFragment, diffEntry, powerPref.getPercent(), getSlotInformation());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -634,11 +628,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
final long foregroundUsageTimeInMs = entry.mForegroundUsageTimeInMs;
|
||||
final long backgroundUsageTimeInMs = entry.mBackgroundUsageTimeInMs;
|
||||
final long totalUsageTimeInMs = foregroundUsageTimeInMs + backgroundUsageTimeInMs;
|
||||
// Checks whether the package is allowed to show summary or not.
|
||||
if (!isValidToShowSummary(entry.getPackageName())) {
|
||||
preference.setSummary(null);
|
||||
return;
|
||||
}
|
||||
String usageTimeSummary = null;
|
||||
// Not shows summary for some system components without usage time.
|
||||
if (totalUsageTimeInMs == 0) {
|
||||
@@ -677,11 +666,6 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
return mPrefContext.getString(resourceId, timeSequence);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
boolean isValidToShowSummary(String packageName) {
|
||||
return !DataProcessor.contains(packageName, mNotAllowShowSummaryPackages);
|
||||
}
|
||||
|
||||
private void animateBatteryChartViewGroup() {
|
||||
if (mBatteryChartViewGroup != null && mBatteryChartViewGroup.getAlpha() == 0) {
|
||||
mBatteryChartViewGroup.animate().alpha(1f).setDuration(FADE_IN_ANIMATION_DURATION)
|
||||
|
Reference in New Issue
Block a user