Deprecate health@1.0

The framework will continue to work with health@1.0 until it is fully deprecated according to the standard HAL deprecation schedule. When health@1.0 is deprecated (entry removed from framework compatibility matrix), healthd and libbatterymonitor must also be removed from system to avoid unknown behaviors for healthd. As health@1.0 is an optional HAL and all healthd dependencies to health@1.0 are guarded by NULL checks, nothing should break on deprecation.

When Android removes the legacy code path (healthd, health@1.0), Health@1.0 HAL is deprecated according to deprecation schedule. In addition, Android also removes the following:

  1. healthd dependency in framework
  2. healthd
  3. health@1.0 HAL definition library from system
  4. health@1.0 entry in framework compatibility matrix

Remove healthd

For devices launching with Android 9 and devices upgrading to Android 9 that provide the Health 2.0 HAL in the new vendor image, we recommend removing healthd from the system image to save disk space and speed boot time.

To do so:

  1. Remove healthd and healthd.rc from the system image by adding the following line to the device-specific implementation in Soong:

    cc_binary {
        name: "android.hardware.health@2.0-service.device_name"
        overrides: ["healthd"],
        // ...
    }
    

    Or, if the module is in Make:

    LOCAL_MODULE_NAME := \
        android.hardware.health@2.0-service.device_name
    LOCAL_OVERRIDES_MODULES := healthd
    

    If the default implementation android.hardware.health@2.0-service is installed, implement a device-specific android.hardware.health@2.0-service.device_name instead. For more information, see Implementing Health.