Update for expanding @2.0::HealthInfo.
Health service also sends other fields in callbacks.
Test: builds
Bug: 62229583
Change-Id: Icb9215c263ba34055e77db3dbb047998bb2da4e8
diff --git a/healthd/HealthService.cpp b/healthd/HealthService.cpp
index e8a1a85..29a29ed 100644
--- a/healthd/HealthService.cpp
+++ b/healthd/HealthService.cpp
@@ -28,8 +28,8 @@
using android::hardware::IPCThreadState;
using android::hardware::configureRpcThreadpool;
-using android::hardware::health::V1_0::HealthInfo;
using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo;
+using android::hardware::health::V2_0::HealthInfo;
using android::hardware::health::V2_0::IHealth;
using android::hardware::health::V2_0::implementation::Health;
@@ -89,9 +89,9 @@
// Implementation-defined update logic goes here. An implementation
// can make modifications to prop before broadcasting it to all callbacks.
- HealthInfo info;
- convertToHealthInfo(prop, info);
- static_cast<Health*>(gHealth.get())->notifyListeners(info);
+ HealthInfo info{};
+ convertToHealthInfo(prop, info.legacy);
+ static_cast<Health*>(gHealth.get())->updateAndNotify(&info);
}
static struct healthd_mode_ops healthd_mode_service_2_0_ops = {