Merge changes from topic "healthd_deprecate2" into pi-dev

* changes:
  healthd: a.h.health@2.0-service.override removes healthd
  healthd: add healthd.rc
diff --git a/healthd/Android.bp b/healthd/Android.bp
index c70278a..cefe09d 100644
--- a/healthd/Android.bp
+++ b/healthd/Android.bp
@@ -20,8 +20,8 @@
     export_header_lib_headers: ["libhealthd_headers"],
 }
 
-cc_binary {
-    name: "android.hardware.health@2.0-service",
+cc_defaults {
+    name: "android.hardware.health@2.0-service_defaults",
     init_rc: ["android.hardware.health@2.0-service.rc"],
     vendor: true,
     relative_install_path: "hw",
@@ -55,7 +55,22 @@
 }
 
 cc_binary {
+    name: "android.hardware.health@2.0-service",
+    defaults: ["android.hardware.health@2.0-service_defaults"],
+}
+
+cc_binary {
+    name: "android.hardware.health@2.0-service.override",
+    defaults: ["android.hardware.health@2.0-service_defaults"],
+
+    overrides: [
+        "healthd",
+    ],
+}
+
+cc_binary {
     name: "healthd",
+    init_rc: ["healthd.rc"],
     srcs: [
         "HealthServiceHealthd.cpp",
     ],
diff --git a/healthd/healthd.rc b/healthd/healthd.rc
new file mode 100644
index 0000000..8e2ebb6
--- /dev/null
+++ b/healthd/healthd.rc
@@ -0,0 +1,4 @@
+service healthd /system/bin/healthd
+    class hal
+    critical
+    group root system wakelock
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 3bbc506..391f42a 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -736,11 +736,6 @@
     seclabel u:r:ueventd:s0
     shutdown critical
 
-service healthd /system/bin/healthd
-    class hal
-    critical
-    group root system wakelock
-
 service console /system/bin/sh
     class core
     console