Merge "Fix crash in Monkey test." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-05 17:46:21 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 1 deletions

View File

@@ -91,6 +91,9 @@ public class BatteryTipPreferenceController extends BasePreferenceController {
}
public void updateBatteryTips(List<BatteryTip> batteryTips) {
if (batteryTips == null) {
return;
}
if (mBatteryTips == null) {
mBatteryTips = batteryTips;
} else {
@@ -100,7 +103,6 @@ public class BatteryTipPreferenceController extends BasePreferenceController {
}
}
//TODO(b/70570352): try to reuse the existing preference rather than remove and add.
mPreferenceGroup.removeAll();
for (int i = 0, size = batteryTips.size(); i < size; i++) {
final BatteryTip batteryTip = mBatteryTips.get(i);