diff options
Diffstat (limited to 'cmds/statsd/src/external/ResourceHealthManagerPuller.cpp')
-rw-r--r-- | cmds/statsd/src/external/ResourceHealthManagerPuller.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp b/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp index 3741202763b3..ae2cf74962c3 100644 --- a/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp +++ b/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp @@ -54,7 +54,7 @@ bool getHealthHal() { ResourceHealthManagerPuller::ResourceHealthManagerPuller(int tagId) : StatsPuller(tagId) { } -// TODO: add other health atoms (eg. Temperature). +// TODO(b/110565992): add other health atoms (eg. Temperature). bool ResourceHealthManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* data) { if (!getHealthHal()) { ALOGE("Health Hal not loaded"); @@ -67,6 +67,7 @@ bool ResourceHealthManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* dat data->clear(); bool result_success = true; + // Get the data from the Health HAL (hardware/interfaces/health/1.0/types.hal). Return<void> ret = gHealthHal->getHealthInfo([&](Result r, HealthInfo v) { if (r != Result::SUCCESS) { result_success = false; @@ -84,6 +85,12 @@ bool ResourceHealthManagerPuller::PullInternal(vector<shared_ptr<LogEvent>>* dat ptr->write(v.legacy.batteryFullCharge); ptr->init(); data->push_back(ptr); + } else if (mTagId == android::util::BATTERY_VOLTAGE) { + auto ptr = make_shared<LogEvent>(android::util::BATTERY_VOLTAGE, + wallClockTimestampNs, elapsedTimestampNs); + ptr->write(v.legacy.batteryVoltage); + ptr->init(); + data->push_back(ptr); } else { ALOGE("Unsupported tag in ResourceHealthManagerPuller: %d", mTagId); } |