summaryrefslogtreecommitdiffstats
path: root/healthd/BatteryMonitor.cpp
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-03-19 15:04:40 -0700
committerTodd Poynor <toddpoynor@google.com>2014-03-20 18:16:14 -0700
commit347c8de285454af2d3cba3d9b43d3bf23b20babb (patch)
treeeaf0ed3ed3de8996e6103c17e7f33a3bc2d63c57 /healthd/BatteryMonitor.cpp
parent2eb5d85b023253af8f56eab6a79ad34e6a2b0878 (diff)
downloadsystem_core-347c8de285454af2d3cba3d9b43d3bf23b20babb.zip
system_core-347c8de285454af2d3cba3d9b43d3bf23b20babb.tar.gz
system_core-347c8de285454af2d3cba3d9b43d3bf23b20babb.tar.bz2
healthd: Add battery capacity to getProperty
Add support for BATTERY_PROP_CAPACITY property in getProperty Bug: 11985952 Change-Id: I905cda68f990fa96138a16a11c55f2d902d0bbc1
Diffstat (limited to 'healthd/BatteryMonitor.cpp')
-rw-r--r--healthd/BatteryMonitor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 3e6a4b1..9368225 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -302,6 +302,16 @@ status_t BatteryMonitor::getProperty(int id, struct BatteryProperty *val) {
}
break;
+ case BATTERY_PROP_CAPACITY:
+ if (!mHealthdConfig->batteryCapacityPath.isEmpty()) {
+ val->valueInt =
+ getIntField(mHealthdConfig->batteryCapacityPath);
+ ret = NO_ERROR;
+ } else {
+ ret = NAME_NOT_FOUND;
+ }
+ break;
+
default:
break;
}