BatteryService: Add Max charging voltage

Bug: 25229483
Change-Id: Ibeba97eb145c3d59a763bd8632ab7fcc43118e4b
(cherry picked from commit f92fcfe36a)
This commit is contained in:
Badhri Jagan Sridharan
2015-10-27 13:59:34 -07:00
committed by Rom Lemarchand
parent 75603fb707
commit 4f72447fbf
3 changed files with 19 additions and 2 deletions

View File

@@ -108,6 +108,13 @@ public class BatteryManager {
*/
public static final String EXTRA_MAX_CHARGING_CURRENT = "max_charging_current";
/**
* Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
* Int value set to the maximum charging voltage supported by the charger in micro volts.
* {@hide}
*/
public static final String EXTRA_MAX_CHARGING_VOLTAGE = "max_charging_voltage";
// values for "status" field in the ACTION_BATTERY_CHANGED Intent
public static final int BATTERY_STATUS_UNKNOWN = 1;
public static final int BATTERY_STATUS_CHARGING = 2;

View File

@@ -23,6 +23,7 @@ public class BatteryProperties implements Parcelable {
public boolean chargerUsbOnline;
public boolean chargerWirelessOnline;
public int maxChargingCurrent;
public int maxChargingVoltage;
public int batteryStatus;
public int batteryHealth;
public boolean batteryPresent;
@@ -39,6 +40,7 @@ public class BatteryProperties implements Parcelable {
chargerUsbOnline = other.chargerUsbOnline;
chargerWirelessOnline = other.chargerWirelessOnline;
maxChargingCurrent = other.maxChargingCurrent;
maxChargingVoltage = other.maxChargingVoltage;
batteryStatus = other.batteryStatus;
batteryHealth = other.batteryHealth;
batteryPresent = other.batteryPresent;
@@ -58,6 +60,7 @@ public class BatteryProperties implements Parcelable {
chargerUsbOnline = p.readInt() == 1 ? true : false;
chargerWirelessOnline = p.readInt() == 1 ? true : false;
maxChargingCurrent = p.readInt();
maxChargingVoltage = p.readInt();
batteryStatus = p.readInt();
batteryHealth = p.readInt();
batteryPresent = p.readInt() == 1 ? true : false;
@@ -72,6 +75,7 @@ public class BatteryProperties implements Parcelable {
p.writeInt(chargerUsbOnline ? 1 : 0);
p.writeInt(chargerWirelessOnline ? 1 : 0);
p.writeInt(maxChargingCurrent);
p.writeInt(maxChargingVoltage);
p.writeInt(batteryStatus);
p.writeInt(batteryHealth);
p.writeInt(batteryPresent ? 1 : 0);