Refactor common code between healthd and health@2.0-service

Use healthd_board_* functions for the
code that's different between them.

Bug: 65990106
Test: boots
Test: VTS tests on healthd and health service
Change-Id: I88e6f210cb91c0cf08a9d7c52910c38fa9a75130
diff --git a/healthd/Android.bp b/healthd/Android.bp
index 4b3274c..21c0ef0 100644
--- a/healthd/Android.bp
+++ b/healthd/Android.bp
@@ -53,7 +53,10 @@
     init_rc: ["android.hardware.health@2.0-service.rc"],
     vendor: true,
     relative_install_path: "hw",
-    srcs: ["HealthService.cpp"],
+    srcs: [
+        "HealthServiceCommon.cpp",
+        "HealthServiceDefault.cpp",
+    ],
 
     cflags: ["-DHEALTH_INSTANCE_NAME=\"default\""],
 
@@ -77,7 +80,10 @@
 
 cc_binary {
     name: "healthd",
-    srcs: ["HealthService.cpp"],
+    srcs: [
+        "HealthServiceCommon.cpp",
+        "HealthServiceHealthd.cpp",
+    ],
     local_include_dirs: ["include"],
 
     cflags: ["-DHEALTH_INSTANCE_NAME=\"backup\""],