OSDN Git Service

batteryservice: add battery current now and charge counter data
authorTodd Poynor <toddpoynor@google.com>
Wed, 31 Jul 2013 02:12:10 +0000 (19:12 -0700)
committerTodd Poynor <toddpoynor@google.com>
Wed, 7 Aug 2013 18:30:13 +0000 (18:30 +0000)
Change-Id: I4b3ea25342d4a03a8e38bfee2ef3b1ce54f82582

include/batteryservice/BatteryService.h
services/batteryservice/BatteryProperties.cpp

index 855262b..829061a 100644 (file)
@@ -52,6 +52,8 @@ struct BatteryProperties {
     bool batteryPresent;
     int batteryLevel;
     int batteryVoltage;
+    int batteryCurrentNow;
+    int batteryChargeCounter;
     int batteryTemperature;
     String8 batteryTechnology;
 
index ab636a9..e4a42ed 100644 (file)
@@ -38,6 +38,8 @@ status_t BatteryProperties::readFromParcel(Parcel* p) {
     batteryPresent = p->readInt32() == 1 ? true : false;
     batteryLevel = p->readInt32();
     batteryVoltage = p->readInt32();
+    batteryCurrentNow = p->readInt32();
+    batteryChargeCounter = p->readInt32();
     batteryTemperature = p->readInt32();
     batteryTechnology = String8((p->readString16()).string());
     return OK;
@@ -52,6 +54,8 @@ status_t BatteryProperties::writeToParcel(Parcel* p) const {
     p->writeInt32(batteryPresent ? 1 : 0);
     p->writeInt32(batteryLevel);
     p->writeInt32(batteryVoltage);
+    p->writeInt32(batteryCurrentNow);
+    p->writeInt32(batteryChargeCounter);
     p->writeInt32(batteryTemperature);
     p->writeString16(String16(batteryTechnology));
     return OK;