Add null check to batterymeterview in case the percent view becomes null
Seems like this can only happen if we have a successful battery reading and then immediately the conditions change causing us to remove the precent view. Test: atest SystemUITests Fixes: 180019511 Change-Id: I4bf8508a9cef18ade62863b07086254e39897059
This commit is contained in:
@@ -349,6 +349,9 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
}
|
||||
|
||||
private void setPercentTextAtCurrentLevel() {
|
||||
if (mBatteryPercentView == null) {
|
||||
return;
|
||||
}
|
||||
mBatteryPercentView.setText(
|
||||
NumberFormat.getPercentInstance().format(mLevel / 100f));
|
||||
setContentDescription(
|
||||
|
||||
Reference in New Issue
Block a user