healthd: charger use health 2.0 HAL
Test: charger_test
Test: off-mode charging, charger runs correctly
Bug: 63702641
Bug: 69268160
Change-Id: I7dfc83ae4020ada7e9d11ab955f648abb74f435b
diff --git a/healthd/charger.cpp b/healthd/charger.cpp
index 5a8fe1a..ede14f2 100644
--- a/healthd/charger.cpp
+++ b/healthd/charger.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "charger"
#define KLOG_LEVEL 6
+#include <health2/Health.h>
#include <healthd/healthd.h>
#include <stdlib.h>
@@ -62,7 +63,9 @@
};
#endif
-static void healthd_mode_nop_init(struct healthd_config* /*config*/) {
+static void healthd_mode_nop_init(struct healthd_config* config) {
+ using android::hardware::health::V2_0::implementation::Health;
+ Health::initInstance(config);
}
static int healthd_mode_nop_preparetowait(void) {