diff --git a/healthd/Android.bp b/healthd/Android.bp index c70278af3..cefe09d5e 100644 --- a/healthd/Android.bp +++ b/healthd/Android.bp @@ -20,8 +20,8 @@ cc_library_static { 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", @@ -54,8 +54,23 @@ cc_binary { ], } +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 000000000..8e2ebb609 --- /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 3bbc50622..391f42a3b 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -736,11 +736,6 @@ service ueventd /sbin/ueventd 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