Implement android.hardware.health@2.0.

healthd_common.cpp uses health@2.0 for health@2.0-service
and healthd.

charger and recovery will be fixed in a follow up change.
(They still use libbatterymonitor for now).

Test: adb logcat -e "health@2.0"
Test: adb shell lshal --debug

Change-Id: I9ff0691d467df37118d7f143693c1bcd17a5bcbf
diff --git a/healthd/Android.bp b/healthd/Android.bp
index 7269b62..d348866 100644
--- a/healthd/Android.bp
+++ b/healthd/Android.bp
@@ -18,3 +18,59 @@
     header_libs: ["libhealthd_headers"],
     export_header_lib_headers: ["libhealthd_headers"],
 }
+
+cc_library_static {
+    name: "android.hardware.health@2.0-impl",
+    vendor_available: true,
+    srcs: [
+        "Health.cpp",
+        "healthd_common.cpp",
+    ],
+
+    cflags: ["-DHEALTHD_USE_HEALTH_2_0"],
+
+    export_include_dirs: ["include"],
+
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "libcutils",
+        "android.hardware.health@2.0",
+    ],
+
+    static_libs: [
+        "libbatterymonitor",
+        "android.hardware.health@1.0-convert",
+    ],
+}
+
+cc_binary {
+    name: "android.hardware.health@2.0-service",
+    init_rc: ["android.hardware.health@2.0-service.rc"],
+    vendor: true,
+    relative_install_path: "hw",
+    srcs: ["HealthService.cpp"],
+
+    cflags: ["-DHEALTH_INSTANCE_NAME=\"default\""],
+
+    static_libs: [
+        "android.hardware.health@2.0-impl",
+        "android.hardware.health@1.0-convert",
+        "libbatterymonitor",
+    ],
+
+    shared_libs: [
+        "libbase",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "liblog",
+        "libutils",
+        "android.hardware.health@2.0",
+    ],
+}