Update battery summary

When it is charging, show "5% - charging"(not only "5%")

Bug: 112013485
Test: RunSettingsRoboTests
Change-Id: If2299cc4929d8fc40d63669b74590fafe39122dc
This commit is contained in:
jackqdyulei
2019-02-14 19:11:10 -08:00
parent 1de961d9ef
commit ef3b364728
2 changed files with 7 additions and 1 deletions

View File

@@ -80,7 +80,9 @@ public class TopLevelBatteryPreferenceController extends BasePreferenceControlle
}
CharSequence label;
final BidiFormatter formatter = BidiFormatter.getInstance();
if (info.remainingLabel == null) {
if (!info.discharging && info.chargeLabel != null) {
label = info.chargeLabel;
} else if (info.remainingLabel == null) {
label = info.batteryPercentString;
} else {
label = context.getString(R.string.power_remaining_settings_home_page,