Fix corner case IndexOutOfBound exception for null content am: bf5dd80d4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14456006 Change-Id: I056a35b964e3a3bef3f461248029a6b848532689
This commit is contained in:
@@ -185,7 +185,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
|||||||
private void setBatteryHistoryMapInner(
|
private void setBatteryHistoryMapInner(
|
||||||
final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) {
|
final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) {
|
||||||
// Resets all battery history data relative variables.
|
// Resets all battery history data relative variables.
|
||||||
if (batteryHistoryMap == null) {
|
if (batteryHistoryMap == null || batteryHistoryMap.isEmpty()) {
|
||||||
mBatteryIndexedMap = null;
|
mBatteryIndexedMap = null;
|
||||||
mBatteryHistoryKeys = null;
|
mBatteryHistoryKeys = null;
|
||||||
mBatteryHistoryLevels = null;
|
mBatteryHistoryLevels = null;
|
||||||
|
Reference in New Issue
Block a user