diff options
| -rw-r--r-- | health/1.0/default/Android.bp | 16 | ||||
| -rw-r--r-- | health/1.0/default/README.md | 66 |
2 files changed, 79 insertions, 3 deletions
diff --git a/health/1.0/default/Android.bp b/health/1.0/default/Android.bp index e4e6ce7b4b..7581335a3a 100644 --- a/health/1.0/default/Android.bp +++ b/health/1.0/default/Android.bp @@ -18,10 +18,9 @@ cc_library_static { } -cc_library_shared { - name: "android.hardware.health@1.0-impl", +cc_library_static { + name: "android.hardware.health@1.0-impl-helper", vendor: true, - relative_install_path: "hw", srcs: ["Health.cpp"], header_libs: [ @@ -39,6 +38,17 @@ cc_library_shared { static_libs: [ "android.hardware.health@1.0-convert", + ], +} + +cc_library_shared { + name: "android.hardware.health@1.0-impl", + vendor: true, + relative_install_path: "hw", + + static_libs: [ + "android.hardware.health@1.0-impl-helper", + "android.hardware.health@1.0-convert", "libhealthd.default", ], } diff --git a/health/1.0/default/README.md b/health/1.0/default/README.md new file mode 100644 index 0000000000..1ded7dede5 --- /dev/null +++ b/health/1.0/default/README.md @@ -0,0 +1,66 @@ +# Implement the 2.1 HAL instead! + +It is strongly recommended that you implement the 2.1 HAL directly. See +`hardware/interfaces/health/2.1/README.md` for more details. + +# Implement Health 1.0 HAL + +1. Install common binderized service. The binderized service `dlopen()`s + passthrough implementations on the device, so there is no need to write + your own. + + ```mk + # Install default binderized implementation to vendor. + PRODUCT_PACKAGES += android.hardware.health@1.0-service + ``` + +1. Add proper VINTF manifest entry to your device manifest. Example: + + ```xml + <hal format="hidl"> + <name>android.hardware.health</name> + <transport>hwbinder</transport> + <version>1.0</version> + <interface> + <name>IHealth</name> + <instance>default</instance> + </interface> + </hal> + ``` + +1. Install the proper passthrough implemetation. + + 1. If you want to use the default implementation (with default `libhealthd`), + add the following to `device.mk`: + + ```mk + PRODUCT_PACKAGES += \ + android.hardware.health@1.0-impl + ``` + + 1. Otherwise, if you have a customized `libhealthd.<board>`: + + 1. Define your passthrough implementation. Example (replace `<device>` + and `<board>` accordingly): + + ```bp + cc_library_shared { + name: "android.hardware.health@1.0-impl-<device>", + vendor: true, + relative_install_path: "hw", + + static_libs: [ + "android.hardware.health@1.0-impl-helper", + "android.hardware.health@1.0-convert", + "libhealthd.<board>", + ], + } + ``` + + 1. Add to `device.mk`. + + ``` + PRODUCT_PACKAGES += android.hardware.health@1.0-impl-<device> + ``` + + 1. Define appropriate SELinux permissions. |
