• Home
Name Date Size #Lines LOC

..--

include/03-May-2024-4522

libhealthd/03-May-2024-4118

Android.bpD03-May-20241.5 KiB7363

Health.cppD03-May-20242.7 KiB9451

Health.hD03-May-20241.9 KiB5834

HealthService.cppD03-May-2024947 288

README.mdD03-May-20241.9 KiB6750

android.hardware.health@1.0-service.rcD03-May-2024156 65

convert.cppD03-May-20246.2 KiB149105

README.md

1# Implement the 2.1 HAL instead!
2
3It is strongly recommended that you implement the 2.1 HAL directly. See
4`hardware/interfaces/health/2.1/README.md` for more details.
5
6# Implement Health 1.0 HAL
7
81. Install common binderized service. The binderized service `dlopen()`s
9   passthrough implementations on the device, so there is no need to write
10   your own.
11
12    ```mk
13    # Install default binderized implementation to vendor.
14    PRODUCT_PACKAGES += android.hardware.health@1.0-service
15    ```
16
171. Add proper VINTF manifest entry to your device manifest. Example:
18
19    ```xml
20    <hal format="hidl">
21        <name>android.hardware.health</name>
22        <transport>hwbinder</transport>
23        <version>1.0</version>
24        <interface>
25            <name>IHealth</name>
26            <instance>default</instance>
27        </interface>
28    </hal>
29    ```
30
311. Install the proper passthrough implemetation.
32
33    1. If you want to use the default implementation (with default `libhealthd`),
34       add the following to `device.mk`:
35
36        ```mk
37        PRODUCT_PACKAGES += \
38            android.hardware.health@1.0-impl
39        ```
40
41    1. Otherwise, if you have a customized `libhealthd.<board>`:
42
43        1. Define your passthrough implementation. Example (replace `<device>`
44           and `<board>` accordingly):
45
46            ```bp
47            cc_library_shared {
48                name: "android.hardware.health@1.0-impl-<device>",
49                vendor: true,
50                relative_install_path: "hw",
51
52                static_libs: [
53                    "android.hardware.health@1.0-impl-helper",
54                    "android.hardware.health@1.0-convert",
55                    "libhealthd.<board>",
56                ],
57            }
58            ```
59
60        1. Add to `device.mk`.
61
62            ```
63            PRODUCT_PACKAGES += android.hardware.health@1.0-impl-<device>
64            ```
65
66        1. Define appropriate SELinux permissions.
67