Add health stub HAL

Change-Id: I00150d1915c1caf47aff4406533a2da769ab8a22
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/device.mk b/device.mk
index 8d1a3bc..dbd85db 100644
--- a/device.mk
+++ b/device.mk
@@ -25,6 +25,10 @@
 DEVICE_PACKAGE_OVERLAYS := device/amlogic/yukawa/overlay
 DEVICE_PACKAGE_OVERLAYS += device/google/atv/overlay
 
+PRODUCT_PACKAGES += \
+    android.hardware.health@2.0-service.yukawa \
+    android.hardware.health@2.0-service
+
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/fstab.yukawa:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.yukawa \
     $(LOCAL_PATH)/init.yukawa.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.yukawa.rc \
diff --git a/health/Android.bp b/health/Android.bp
new file mode 100644
index 0000000..a8174fa
--- /dev/null
+++ b/health/Android.bp
@@ -0,0 +1,30 @@
+cc_binary {
+    name: "android.hardware.health@2.0-service.yukawa",
+    init_rc: ["android.hardware.health@2.0-service.yukawa.rc"],
+    proprietary: true,
+    relative_install_path: "hw",
+    srcs: [
+        "HealthService.cpp",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    static_libs: [
+        "android.hardware.health@2.0-impl",
+        "android.hardware.health@1.0-convert",
+        "libhealthservice",
+        "libbatterymonitor",
+        "libhealthstoragedefault",
+    ],
+    shared_libs: [
+        "libbase",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+        "android.hardware.health@2.0",
+    ],
+    header_libs: ["libhealthd_headers"],
+}
diff --git a/health/HealthService.cpp b/health/HealthService.cpp
new file mode 100644
index 0000000..2498a5c
--- /dev/null
+++ b/health/HealthService.cpp
@@ -0,0 +1,12 @@
+#include <health2/service.h>
+#include <healthd/healthd.h>
+
+int main() {
+    return health_service_main();
+}
+
+void healthd_board_init(struct healthd_config*) {}
+
+int healthd_board_battery_update(struct android::BatteryProperties*) {
+    return 0;
+}
diff --git a/health/android.hardware.health@2.0-service.yukawa.rc b/health/android.hardware.health@2.0-service.yukawa.rc
new file mode 100644
index 0000000..93a7863
--- /dev/null
+++ b/health/android.hardware.health@2.0-service.yukawa.rc
@@ -0,0 +1,5 @@
+service vendor.health-hal-2-0 /vendor/bin/hw/android.hardware.health@2.0-service.yukawa
+    class hal
+    user system
+    group system
+    file /dev/kmsg w