batteryservice: add battery current now and charge counter data
Available for retrieval via future APIs if desired. Dumped by dumpsys.
Not added to batterystats or ACTION_BATTERY_CHANGED intents at this point.
Also fixes a formatting problem in the existing dumpsys output for voltage.
Change-Id: I5320b19035914256fb872c13095c09c648dd522a
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java
index 457539f..5f3f894 100644
--- a/services/java/com/android/server/BatteryService.java
+++ b/services/java/com/android/server/BatteryService.java
@@ -314,6 +314,8 @@
+ ", batteryLevel=" + mBatteryProps.batteryLevel
+ ", batteryTechnology=" + mBatteryProps.batteryTechnology
+ ", batteryVoltage=" + mBatteryProps.batteryVoltage
+ + ", batteryCurrentNow=" + mBatteryProps.batteryCurrentNow
+ + ", batteryChargeCounter=" + mBatteryProps.batteryChargeCounter
+ ", batteryTemperature=" + mBatteryProps.batteryTemperature
+ ", mBatteryLevelCritical=" + mBatteryLevelCritical
+ ", mPlugType=" + mPlugType);
@@ -613,7 +615,16 @@
pw.println(" present: " + mBatteryProps.batteryPresent);
pw.println(" level: " + mBatteryProps.batteryLevel);
pw.println(" scale: " + BATTERY_SCALE);
- pw.println(" voltage:" + mBatteryProps.batteryVoltage);
+ pw.println(" voltage: " + mBatteryProps.batteryVoltage);
+
+ if (mBatteryProps.batteryCurrentNow != Integer.MIN_VALUE) {
+ pw.println(" current now: " + mBatteryProps.batteryCurrentNow);
+ }
+
+ if (mBatteryProps.batteryChargeCounter != Integer.MIN_VALUE) {
+ pw.println(" charge counter: " + mBatteryProps.batteryChargeCounter);
+ }
+
pw.println(" temperature: " + mBatteryProps.batteryTemperature);
pw.println(" technology: " + mBatteryProps.batteryTechnology);
} else if (args.length == 3 && "set".equals(args[0])) {