Update keyguard charging text to indicate wireless

- Keyguard charging text indicates the device is wirelessly charging

Test: manual
Change-Id: I9cce8ecaf07f8870164d9ef8a569fcf30db69d85
Fixes: 124084552
This commit is contained in:
Beverly
2019-02-11 13:58:27 -05:00
parent 5fd6011770
commit 7d7f699f4a
3 changed files with 28 additions and 16 deletions

View File

@@ -64,6 +64,9 @@
charged, say that it is charged. --> charged, say that it is charged. -->
<string name="keyguard_charged">Fully charged</string> <string name="keyguard_charged">Fully charged</string>
<!-- When the lock screen is showing and the phone plugged in, and the battery is not fully charged, say that it's wirelessly charging. [CHAR LIMIT=50] -->
<string name="keyguard_plugged_in_wireless"><xliff:g id="percentage" example="20%">%s</xliff:g> • Wirelessly Charging</string>
<!-- When the lock screen is showing and the phone plugged in, and the battery <!-- When the lock screen is showing and the phone plugged in, and the battery
is not fully charged, say that it's charging. --> is not fully charged, say that it's charging. -->
<string name="keyguard_plugged_in"><xliff:g id="percentage">%s</xliff:g> • Charging</string> <string name="keyguard_plugged_in"><xliff:g id="percentage">%s</xliff:g> • Charging</string>

View File

@@ -955,6 +955,9 @@
<!-- Interruption level: Alarms only. Optimized for narrow two-line display. [CHAR LIMIT=40] --> <!-- Interruption level: Alarms only. Optimized for narrow two-line display. [CHAR LIMIT=40] -->
<string name="interruption_level_alarms_twoline">Alarms\nonly</string> <string name="interruption_level_alarms_twoline">Alarms\nonly</string>
<!-- Indication on the keyguard that is shown when the device is wirelessly charging. [CHAR LIMIT=80]-->
<string name="keyguard_indication_charging_time_wireless"><xliff:g id="percentage" example="20%">%2$s</xliff:g> • Wirelessly Charging (<xliff:g id="charging_time_left" example="4 hours and 2 minutes">%1$s</xliff:g> until full)</string>
<!-- Indication on the keyguard that is shown when the device is charging. [CHAR LIMIT=50]--> <!-- Indication on the keyguard that is shown when the device is charging. [CHAR LIMIT=50]-->
<string name="keyguard_indication_charging_time"><xliff:g id="percentage">%2$s</xliff:g> • Charging (<xliff:g id="charging_time_left" example="4 hours and 2 minutes">%1$s</xliff:g> until full)</string> <string name="keyguard_indication_charging_time"><xliff:g id="percentage">%2$s</xliff:g> • Charging (<xliff:g id="charging_time_left" example="4 hours and 2 minutes">%1$s</xliff:g> until full)</string>

View File

@@ -424,6 +424,7 @@ public class KeyguardIndicationController implements StateListener {
final boolean hasChargingTime = chargingTimeRemaining > 0; final boolean hasChargingTime = chargingTimeRemaining > 0;
int chargingId; int chargingId;
if (mPowerPluggedInWired) {
switch (mChargingSpeed) { switch (mChargingSpeed) {
case KeyguardUpdateMonitor.BatteryStatus.CHARGING_FAST: case KeyguardUpdateMonitor.BatteryStatus.CHARGING_FAST:
chargingId = hasChargingTime chargingId = hasChargingTime
@@ -441,6 +442,11 @@ public class KeyguardIndicationController implements StateListener {
: R.string.keyguard_plugged_in; : R.string.keyguard_plugged_in;
break; break;
} }
} else {
chargingId = hasChargingTime
? R.string.keyguard_indication_charging_time_wireless
: R.string.keyguard_plugged_in_wireless;
}
String percentage = NumberFormat.getPercentInstance() String percentage = NumberFormat.getPercentInstance()
.format(mBatteryLevel / 100f); .format(mBatteryLevel / 100f);