BatteryProperty: Add property ENERGY_COUNTER and 64-bit integer properties
Also fixup comments to match recent changes in BatteryManager. Change-Id: I6f40924f9e66d564ad1175f9650e2bfd2ad39a3a
This commit is contained in:
parent
37a5e7a21a
commit
a186e65368
@ -18,6 +18,7 @@
|
|||||||
#define ANDROID_BATTERYSERVICE_H
|
#define ANDROID_BATTERYSERVICE_H
|
||||||
|
|
||||||
#include <binder/Parcel.h>
|
#include <binder/Parcel.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <utils/Errors.h>
|
#include <utils/Errors.h>
|
||||||
#include <utils/String8.h>
|
#include <utils/String8.h>
|
||||||
|
|
||||||
@ -45,10 +46,11 @@ enum {
|
|||||||
|
|
||||||
// must be kept in sync with definitions in BatteryProperty.java
|
// must be kept in sync with definitions in BatteryProperty.java
|
||||||
enum {
|
enum {
|
||||||
BATTERY_PROP_CHARGE_COUNTER = 1, // equals BatteryProperty.BATTERY_PROP_CHARGE_COUNTER constant
|
BATTERY_PROP_CHARGE_COUNTER = 1, // equals BatteryProperty.CHARGE_COUNTER constant
|
||||||
BATTERY_PROP_CURRENT_NOW = 2, // equals BatteryProperty.BATTERY_PROP_CURRENT_NOW constant
|
BATTERY_PROP_CURRENT_NOW = 2, // equals BatteryProperty.CURRENT_NOW constant
|
||||||
BATTERY_PROP_CURRENT_AVG = 3, // equals BatteryProperty.BATTERY_PROP_CURRENT_AVG constant
|
BATTERY_PROP_CURRENT_AVG = 3, // equals BatteryProperty.CURRENT_AVG constant
|
||||||
BATTERY_PROP_CAPACITY = 4, // equals BatteryProperty.BATTERY_PROP_CAPACITY constant
|
BATTERY_PROP_CAPACITY = 4, // equals BatteryProperty.CAPACITY constant
|
||||||
|
BATTERY_PROP_ENERGY_COUNTER = 5, // equals BatteryProperty.ENERGY_COUNTER constant
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BatteryProperties {
|
struct BatteryProperties {
|
||||||
@ -68,7 +70,7 @@ struct BatteryProperties {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct BatteryProperty {
|
struct BatteryProperty {
|
||||||
int valueInt;
|
int64_t valueInt64;
|
||||||
|
|
||||||
status_t writeToParcel(Parcel* parcel) const;
|
status_t writeToParcel(Parcel* parcel) const;
|
||||||
status_t readFromParcel(Parcel* parcel);
|
status_t readFromParcel(Parcel* parcel);
|
||||||
|
@ -28,12 +28,12 @@ namespace android {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
status_t BatteryProperty::readFromParcel(Parcel* p) {
|
status_t BatteryProperty::readFromParcel(Parcel* p) {
|
||||||
valueInt = p->readInt32();
|
valueInt64 = p->readInt64();
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t BatteryProperty::writeToParcel(Parcel* p) const {
|
status_t BatteryProperty::writeToParcel(Parcel* p) const {
|
||||||
p->writeInt32(valueInt);
|
p->writeInt64(valueInt64);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user