health: add health HAL and it's default implementation.
The default Health HAL implementation continues to depend on
libhealthd.<target> BOARD_HAL_STATIC_LIBRARY in order to make
sure healthd continues to work.
New device specific Health HAL implentations don't need to
compile with healthd STATIC_HAL.
Test: Tested healthd with and without the static hal implementation
on Angler.
BUG: b/32724915
Change-Id: I25d439f24a4178666614faf196423ffc8ccafafb
Signed-off-by: Sandeep Patil <sspatil@google.com>
diff --git a/health/1.0/default/Health.h b/health/1.0/default/Health.h
new file mode 100644
index 0000000..c05751f
--- /dev/null
+++ b/health/1.0/default/Health.h
@@ -0,0 +1,42 @@
+#ifndef HIDL_GENERATED_android_hardware_health_V1_0_Health_H_
+#define HIDL_GENERATED_android_hardware_health_V1_0_Health_H_
+
+#include <android/hardware/health/1.0/IHealth.h>
+#include <hidl/Status.h>
+#include <hidl/MQDescriptor.h>
+#include <healthd/healthd.h>
+#include <utils/String8.h>
+
+namespace android {
+namespace hardware {
+namespace health {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::health::V1_0::HealthInfo;
+using ::android::hardware::health::V1_0::HealthConfig;
+using ::android::hardware::health::V1_0::IHealth;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Health : public IHealth {
+ // Methods from ::android::hardware::health::V1_0::IHealth follow.
+ Return<void> init(const HealthConfig& config, init_cb _hidl_cb) override;
+ Return<void> update(const HealthInfo& info, update_cb _hidl_cb) override;
+ Return<void> energyCounter(energyCounter_cb _hidl_cb) override;
+private:
+ std::function<int(int64_t *)> mGetEnergyCounter;
+};
+
+extern "C" IHealth* HIDL_FETCH_IHealth(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace health
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_health_V1_0_Health_H_