From 347c8de285454af2d3cba3d9b43d3bf23b20babb Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Wed, 19 Mar 2014 15:04:40 -0700 Subject: healthd: Add battery capacity to getProperty Add support for BATTERY_PROP_CAPACITY property in getProperty Bug: 11985952 Change-Id: I905cda68f990fa96138a16a11c55f2d902d0bbc1 --- healthd/BatteryMonitor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } -- cgit v1.1