[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
diff --git a/health/2.0/default/Android.bp b/health/2.0/default/Android.bp
index a85a704..ead560b 100644
--- a/health/2.0/default/Android.bp
+++ b/health/2.0/default/Android.bp
@@ -33,7 +33,11 @@
     vendor_available: true,
     srcs: [
         "Health.cpp",
-        "healthd_common.cpp",
+        "healthd_common_adapter.cpp",
+    ],
+
+    whole_static_libs: [
+        "libhealthloop",
     ],
 
     export_include_dirs: ["include"],