Merge "healthd-ext: replace to use AIDL implementation"
diff --git a/aidl/Android.bp b/aidl/Android.bp
index 63b07f2..4c0f0a0 100644
--- a/aidl/Android.bp
+++ b/aidl/Android.bp
@@ -31,6 +31,7 @@
cc_binary {
name: "android.hardware.health-service.qti",
+ recovery: false,
vendor: true,
defaults: ["android.hardware.health-service.qti-defaults"],
init_rc: ["android.hardware.health-service.qti.rc"],
@@ -39,7 +40,8 @@
cc_binary {
name: "android.hardware.health-service.qti_recovery",
- vendor: true,
+ vendor: false,
+ recovery: true,
defaults: ["android.hardware.health-service.qti-defaults"],
init_rc: ["android.hardware.health-service.qti_recovery.rc"],
overrides: ["charger.recovery"],
diff --git a/aidl/main.cpp b/aidl/main.cpp
index 943a537..7c8c7cd 100644
--- a/aidl/main.cpp
+++ b/aidl/main.cpp
@@ -18,6 +18,13 @@
#if !CHARGER_FORCE_NO_UI
using aidl::android::hardware::health::charger::ChargerCallback;
using aidl::android::hardware::health::charger::ChargerModeMain;
+namespace aidl::android::hardware::health {
+class ChargerCallbackImpl : public ChargerCallback {
+ public:
+ ChargerCallbackImpl(const std::shared_ptr<Health>& service) : ChargerCallback(service) {}
+ bool ChargerEnableSuspend() override { return true; }
+};
+} //namespace aidl::android::hardware::health
#endif
static constexpr const char* gInstanceName = "default";
@@ -78,7 +85,8 @@
if (argc >= 2 && argv[1] == gChargerArg) {
#if !CHARGER_FORCE_NO_UI
KLOG_INFO(LOG_TAG, "Starting charger mode with UI.");
- return ChargerModeMain(binder, std::make_shared<ChargerCallback>(binder));
+ auto charger_callback = std::make_shared<aidl::android::hardware::health::ChargerCallbackImpl>(binder);
+ return ChargerModeMain(binder, charger_callback);
#endif
KLOG_INFO(LOG_TAG, "Starting charger mode without UI.");
} else {