From b6f7e58a642fcd8807386f72da7e1c45e77f0dcb Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 31 Jan 2020 13:25:39 -0800 Subject: [PATCH 1/2] Add default health 2.1 service to class charger ... so that it starts up in charger mode. Test: boot charger and look at serial log Bug: 142674987 Change-Id: Ic535b86840df1408b76e556f942aebdd9aaba111 --- health/2.1/default/android.hardware.health@2.1-service.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health/2.1/default/android.hardware.health@2.1-service.rc b/health/2.1/default/android.hardware.health@2.1-service.rc index 917f1c2f19..b6d9e3bcf3 100644 --- a/health/2.1/default/android.hardware.health@2.1-service.rc +++ b/health/2.1/default/android.hardware.health@2.1-service.rc @@ -1,5 +1,5 @@ service health-hal-2-1 /vendor/bin/hw/android.hardware.health@2.1-service - class hal + class hal charger user system group system capabilities WAKE_ALARM From b9c408206130e790751c77033519e99c7db99575 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 31 Jan 2020 17:19:55 -0800 Subject: [PATCH 2/2] Update health 2.1 README for non A/B devices. Non A/B devices should install the passthrough health impl to recovery for IsBatteryOk() check during OTA updates. Test: pass Change-Id: Ib83518fd5f8f55f693be88a55fa708459a22417f --- health/2.1/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/health/2.1/README.md b/health/2.1/README.md index bfcf13bc95..1ab306f83b 100644 --- a/health/2.1/README.md +++ b/health/2.1/README.md @@ -24,6 +24,9 @@ ```mk # Install default passthrough implementation to vendor. PRODUCT_PACKAGES += android.hardware.health@2.1-impl + + # For non-A/B devices, install default passthrough implementation to recovery. + PRODUCT_PACKAGES += android.hardware.health@2.1-impl.recovery ``` You are done. Otherwise, go to the next step. @@ -42,6 +45,8 @@ implementation, See [Upgrading from Health HAL 2.0](#update-from-2-0). + 1. [Install the implementation](#install). + 1. [Update necessary SELinux permissions](#selinux). 1. [Fix `/charger` symlink](#charger-symlink). @@ -95,6 +100,18 @@ and `update()`, with an additional `energyCounter()` function. `HealthImpl::getHealthInfo` or `HealthImpl::getHealthInfo_2_1` because they call `getDiskStats` and `getStorageInfo` to retrieve storage information. +# Install the implementation {#install} + +In `device.mk`: + +```mk +# Install the passthrough implementation to vendor. +PRODUCT_PACKAGES += android.hardware.health@2.1-impl- + +# For non-A/B devices, also install the passthrough implementation to recovery. +PRODUCT_PACKAGES += android.hardware.health@2.1-impl-.recovery +``` + # Update necessary SELinux permissions {#selinux} For example (replace `` with the device name):