Update battery charge/drain label.
Match UX spec. Change-Id: If1408458d488ac2ae3a63449e44ff18fc56e08d5
This commit is contained in:
@@ -444,9 +444,13 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static String getBatteryPercentage(Intent batteryChangedIntent) {
|
||||
return String.valueOf(getBatteryLevel(batteryChangedIntent)) + "%";
|
||||
}
|
||||
|
||||
public static int getBatteryLevel(Intent batteryChangedIntent) {
|
||||
int level = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
|
||||
int scale = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 100);
|
||||
return String.valueOf(level * 100 / scale) + "%";
|
||||
return (level * 100) / scale;
|
||||
}
|
||||
|
||||
public static String getBatteryStatus(Resources res, Intent batteryChangedIntent) {
|
||||
|
Reference in New Issue
Block a user