healthd: more testing, still fails to find passthrough impl
diff --git a/device-common.mk b/device-common.mk
index 2ed8452..d27500d 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -165,7 +165,12 @@
# Health
PRODUCT_PACKAGES += \
android.hardware.health@2.1-service \
- android.hardware.health@2.1-impl-sdm845
+ android.hardware.health@2.1-impl-sdm845 \ # Passthrough implementation
+
+# Cuttlefish health
+# PRODUCT_PACKAGES += \
+# android.hardware.health@2.1-impl-cuttlefish \
+# android.hardware.health@2.1-service
# mkbootimg host tool to build boot.img separately
PRODUCT_HOST_PACKAGES := \
diff --git a/health/Android.bp b/health/Android.bp
index aa42032..16b2ab4 100644
--- a/health/Android.bp
+++ b/health/Android.bp
@@ -1,10 +1,10 @@
cc_library_shared {
name: "android.hardware.health@2.1-impl-sdm845",
- stem: "android.hardware.health@2.0-impl-2.1-sdm845",
+ //stem: "android.hardware.health@2.1-impl-2.1-sdm845",
// Install to vendor and recovery.
vendor: true,
- recovery_available: true,
+ //recovery_available: true,
relative_install_path: "hw",
diff --git a/health/HealthImpl.cpp b/health/HealthImpl.cpp
index 1f7a9d1..d5b004c 100644
--- a/health/HealthImpl.cpp
+++ b/health/HealthImpl.cpp
@@ -35,7 +35,7 @@
// Return<void> getCurrentAverage(getCurrentAverage_cb _hidl_cb) override;
// Return<void> getCapacity(getCapacity_cb _hidl_cb) override;
// Return<void> getEnergyCounter(getEnergyCounter_cb _hidl_cb) override;
- //Return<void> getChargeStatus(getChargeStatus_cb _hidl_cb) override;
+ // Return<void> getChargeStatus(getChargeStatus_cb _hidl_cb) override;
// Return<void> getStorageInfo(getStorageInfo_cb _hidl_cb) override;
// Return<void> getDiskStats(getDiskStats_cb _hidl_cb) override;
// Return<void> getHealthInfo(getHealthInfo_cb _hidl_cb) override;
@@ -52,28 +52,35 @@
// void UpdateHealthInfo(HealthInfo* health_info) override;
};
+// Return<void> HealthImpl::getChargeStatus(getChargeStatus_cb _hidl_cb) {
+// std::string statusPath = "/sys/class/power_supply/usb"
+// getHealthInfo_2_1([&](auto res, const auto& health_info) {
+
+// _hidl_cb(res, health_info);
+
+// });
+
+// return Void();
+// }
+
} // namespace implementation
} // namespace V2_1
} // namespace health
} // namespace hardware
} // namespace android
-void healthd_board_init(healthd_config *config) {
- // The battery doesn't expose it's status, only the charger does.
- config->batteryStatusPath = "/sys/class/power_supply/usb/status";
-}
-
extern "C" IHealth* HIDL_FETCH_IHealth(const char* instance) {
using ::android::hardware::health::V2_1::implementation::HealthImpl;
+ ALOGI("Instance is %s", instance);
if (instance != "default") {
return nullptr;
}
+ ALOGI("Before InitHealthdConfig()");
auto config = std::make_unique<healthd_config>();
InitHealthdConfig(config.get());
+ config->batteryStatusPath = "/sys/class/power_supply/usb/status";
- healthd_board_init(config.get());
-
- ALOGI("CA: Creating Health HAL 2.1, status path = %s", config->batteryStatusPath.c_str());
+ ALOGI("CA: HAL 2.1!!!! health, status path = %s", config->batteryStatusPath.c_str());
return new HealthImpl(std::move(config));
}