platform_hardware_interfaces/health/utils/libhealthloop
Yifan Hong 50c9e25251 [REFACTOR] health 2.0: healthd_common -> libhealthloop
This change converts the original healthd_common.cpp to a
C++ class, HealthLoop, that manages the infinite loop in health-related
modules (charger, health HAL, healthd, etc.). By doing so, the global
static variables (including FDs and healthd_mode_ops) are cleaned up.

This helps us implement health HAL 2.1.

In order to support legacy modules (namely, healthd, charger, health HAL
2.0, which all depends on android.hardware.health@2.0-impl), a
healthd_common_adapter.cpp file is added to
android.hardware.health@2.0-impl, so that the following functions
in healthd/healthd.h continues to be implemented using the global
healthd_mode_ops:
    - healthd_register_event
    - healthd_battery_update_internal

Test: boot up the device and run VTS test on health HAL.
Bug: 137670450
Bug: 142260281
Change-Id: Iadcfc1315155404a3600f0e1219b5bc370d96409
2019-10-14 15:24:21 -07:00
..
include/health [REFACTOR] health 2.0: healthd_common -> libhealthloop 2019-10-14 15:24:21 -07:00
Android.bp [REFACTOR] health 2.0: healthd_common -> libhealthloop 2019-10-14 15:24:21 -07:00
HealthLoop.cpp [REFACTOR] health 2.0: healthd_common -> libhealthloop 2019-10-14 15:24:21 -07:00
utils.cpp [REFACTOR] health 2.0: healthd_common -> libhealthloop 2019-10-14 15:24:21 -07:00