summaryrefslogtreecommitdiff
path: root/health
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2022-03-02 19:20:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-03-02 19:20:31 +0000
commite9cb1bedfd8dfa1b3627c5b521d4507eaf4583c3 (patch)
treee3389227506b268ab878e9e2e326015bf4d279f1 /health
parent20b69d76d0db55ddcae60730a338fb370bd9349a (diff)
parentbc84a7903ad87397317ee8839110f73c6d46fdc5 (diff)
Merge "health: batterymonitor uses AIDL HealthInfo."
Diffstat (limited to 'health')
-rw-r--r--health/aidl/default/Health.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index e1d198221c..d41d01a450 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -130,12 +130,7 @@ ndk::ScopedAStatus Health::getStorageInfo(std::vector<StorageInfo>*) {
ndk::ScopedAStatus Health::getHealthInfo(HealthInfo* out) {
battery_monitor_.updateValues();
- // TODO(b/177269435): BatteryMonitor should store AIDL HealthInfo instead.
- auto health_info_2_1 = battery_monitor_.getHealthInfo_2_1();
- if (!::android::h2a::translate(health_info_2_1, out)) {
- return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(
- IHealth::STATUS_UNKNOWN, "Cannot translate HIDL HealthInfo to AIDL");
- }
+ *out = battery_monitor_.getHealthInfo();
// Fill in storage infos; these aren't retrieved by BatteryMonitor.
if (auto res = getStorageInfo(&out->storageInfos); !res.isOk()) {