Fix b/277880435: System battery settings app crash

Bug: 277880435
Fix: 277880435
Test: manual
Change-Id: I369c04584c95c13e8636b5c9713e26e528ab627a
This commit is contained in:
Zaiyue Xue
2023-04-13 11:23:46 +08:00
parent c00fb2efbd
commit 29da0e6d9f

View File

@@ -296,6 +296,10 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
});
mHourlyChartView = hourlyChartView;
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) {
return;
}