From fd1aa70a0f05578fb7ac1502255aa62178e7f0ce Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 4 Apr 2018 14:08:04 -0700 Subject: [PATCH 1/2] healthd: add healthd.rc Split healthd section from init.rc into its own. This allows healthd.rc to be excluded from the build when healthd is excluded. Test: builds Test: exclude healthd from build, healthd.rc is not installed Bug: 77541952 Change-Id: I1c055f14c5862631f359fd0029289da8f43af063 --- healthd/Android.bp | 1 + healthd/healthd.rc | 4 ++++ rootdir/init.rc | 5 ----- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 healthd/healthd.rc diff --git a/healthd/Android.bp b/healthd/Android.bp index c70278af3..a28544e6c 100644 --- a/healthd/Android.bp +++ b/healthd/Android.bp @@ -56,6 +56,7 @@ cc_binary { 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 From 1cf853fb6562d57ac794be1f6cbf6fba539a3f1d Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 4 Apr 2018 14:08:57 -0700 Subject: [PATCH 2/2] healthd: a.h.health@2.0-service.override removes healthd Removes healthd from the build if -service.override is provided. This encourages developers to deprecate healthd for their devices when they can. When -service.override is used, framework manifest needs to remove the /backup instance as well; this can be done by including manifest_healthd_exclude.xml in DEVICE_FRAMEWORK_MANIFEST_FILE. Test: build and boot on 2016/2017 Pixel devices Test: build and boot on a new device Test: lshal and vts_treble_vintf_test on all these devices Bug: 77541952 Change-Id: I25744feaad3034441cd7a96a5343d4ce3eedc288 --- healthd/Android.bp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/healthd/Android.bp b/healthd/Android.bp index a28544e6c..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,6 +54,20 @@ 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"],