From bc84a7903ad87397317ee8839110f73c6d46fdc5 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 1 Mar 2022 12:24:55 -0800 Subject: [PATCH] health: batterymonitor uses AIDL HealthInfo. As a side effect, chargerDockOnline is properly set. Test: TH Bug: 222120465 Change-Id: I660e8ac0d1897ce30e3ae5d4f402a0b9ccac3c5c --- health/aidl/default/Health.cpp | 7 +------ 1 file changed, 1 insertion(+), 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*) { 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()) {