Merge "Fix b/277880435: System battery settings app crash" into udc-dev

This commit is contained in:
Treehugger Robot
2023-04-13 04:50:59 +00:00
committed by Android (Google) Code Review

View File

@@ -296,6 +296,10 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
}); });
mHourlyChartView = hourlyChartView; mHourlyChartView = hourlyChartView;
mHourlyChartView.setOnSelectListener(trapezoidIndex -> { mHourlyChartView.setOnSelectListener(trapezoidIndex -> {
if (mDailyChartIndex == BatteryChartViewModel.SELECTED_INDEX_ALL) {
// This will happen when a daily slot and an hour slot are clicked together.
return;
}
if (mHourlyChartIndex == trapezoidIndex) { if (mHourlyChartIndex == trapezoidIndex) {
return; return;
} }