mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "health: batterymonitor uses AIDL HealthInfo." am: e9cb1bedfd am: 577ea5663a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2004612 Change-Id: I128383c5984c525a42378e66ae47126dc11e717c
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user