Browse Source

Fix current formating on lockscreen for devices, that report directly in Ampere. Based on : base: Lockscreen Charging info (3/3) by: xyyx <xyyx@mail.ru>

original commit-message:

 base: Lockscreen Charging info (3/3)

 based on: [2/2] frameworks: show charging current & voltage on lockscreen by
 yank555-lu [2/2]Base: show more battery info on lockscreen when charging by
 yank555-lu LockscreenCharging: Use double for mChargingVoltage and show as
 4.XV by xyyx Lockscreen charging: Formatting improvements by nathanchance

AICPfy:
- default set to false
- Current formatting improvement for devices reporting directly in Amps

Signed-off-by: Jens Lody <jens@jenslody.de>
ten
Jens Lody 2 years ago
parent
commit
9a3e882392

+ 3
- 1
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java View File

@@ -742,7 +742,9 @@ public class KeyguardIndicationController implements StateListener,
Settings.System.LOCKSCREEN_BATTERY_INFO, 1, UserHandle.USER_CURRENT) == 1;
if (showbatteryInfo) {
if (mChargingCurrent > 0) {
batteryInfo = batteryInfo + String.format("%.2f", (mChargingCurrent / 1000 / 1000)) + "A";
batteryInfo = batteryInfo + String.format("%.2f", (mChargingCurrent < 5 ?
mChargingCurrent : (mChargingCurrent < 4000 ?
mChargingCurrent / 1000 : (mChargingCurrent / 1000 / 1000)))) + "A";
}
if (mChargingVoltage > 0) {
batteryInfo = (batteryInfo == "" ? "" : batteryInfo + " · ") +

Loading…
Cancel
Save