platform_hardware_interfaces/health/1.0/default
Yifan Hong b808bd7d46 health 1.0: add helper library for -impl
Now that libhealthd is no longer recognized as a HAL_STATIC_LIBRARY,
vendors must define their own android.hardware.health@1.0-impl module.
Add a helper and README.md for them to explain this transition.

Test: builds
Bug: 127677771
Change-Id: I65c162e7b5caed93c39a4a1cb6a2893fbb25724b
2019-12-03 12:51:45 -08:00
..
include health: add health HAL and it's default implementation. 2016-11-11 09:28:23 -08:00
libhealthd libhealthd.default: Mark as recovery_available. 2018-08-07 21:47:46 -07:00
Android.bp health 1.0: add helper library for -impl 2019-12-03 12:51:45 -08:00
android.hardware.health@1.0-service.rc health: Add CAP_WAKE_ALARM to service 2019-01-06 16:07:50 +00:00
convert.cpp health: add health HAL and it's default implementation. 2016-11-11 09:28:23 -08:00
Health.cpp health: add health HAL and it's default implementation. 2016-11-11 09:28:23 -08:00
Health.h Added AOSP license headers. 2016-11-29 23:07:09 +00:00
HealthService.cpp health HAL uses "default" service name 2017-02-17 01:21:09 +00:00
README.md health 1.0: add helper library for -impl 2019-12-03 12:51:45 -08:00

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.

    # Install default binderized implementation to vendor.
    PRODUCT_PACKAGES += android.hardware.health@1.0-service
    
  2. Add proper VINTF manifest entry to your device manifest. Example:

    <hal format="hidl">
        <name>android.hardware.health</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IHealth</name>
            <instance>default</instance>
        </interface>
    </hal>
    
  3. Install the proper passthrough implemetation.

    1. If you want to use the default implementation (with default libhealthd), add the following to device.mk:

      PRODUCT_PACKAGES += \
          android.hardware.health@1.0-impl
      
    2. Otherwise, if you have a customized libhealthd.<board>:

      1. Define your passthrough implementation. Example (replace <device> and <board> accordingly):

        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>",
            ],
        }
        
      2. Add to device.mk.

        PRODUCT_PACKAGES += android.hardware.health@1.0-impl-<device>
        
      3. Define appropriate SELinux permissions.