Merge "Add missing null check for mBatteryPercentView." into sc-dev

This commit is contained in:
Peter Collingbourne
2021-03-19 02:55:42 +00:00
committed by Android (Google) Code Review

View File

@@ -326,6 +326,9 @@ public class BatteryMeterView extends LinearLayout implements
if (mBatteryPercentView != null) {
if (mShowPercentMode == MODE_ESTIMATE && !mCharging) {
mBatteryController.getEstimatedTimeRemainingString((String estimate) -> {
if (mBatteryPercentView == null) {
return;
}
if (estimate != null) {
mBatteryPercentView.setText(estimate);
setContentDescription(getContext().getString(