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:
Evan Laird
2021-03-23 10:38:01 -04:00
parent 9db9a56c7e
commit cd5ed7fa41

View File

@@ -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(