health: fix running HAL in recovery mode.
- Add proper RC files
- overrides charger.recovery
- update readme for implementing recovery mode
Test: pass
Bug: 177269435
Change-Id: Id60b57978e4e5bf78af32bd67523333ba0c2a04d
diff --git a/health/aidl/default/main.cpp b/health/aidl/default/main.cpp
index 76c6ba0..03b2ecb 100644
--- a/health/aidl/default/main.cpp
+++ b/health/aidl/default/main.cpp
@@ -39,14 +39,16 @@
static constexpr std::string_view gChargerArg{"--charger"};
int main(int argc, char** argv) {
+#ifdef __ANDROID_RECOVERY__
+ android::base::InitLogging(argv, android::base::KernelLogger);
+#endif
+
// make a default health service
auto config = std::make_unique<healthd_config>();
::android::hardware::health::InitHealthdConfig(config.get());
auto binder = ndk::SharedRefBase::make<Health>(gInstanceName, std::move(config));
if (argc >= 2 && argv[1] == gChargerArg) {
- android::base::InitLogging(argv, &android::base::KernelLogger);
-
#if !CHARGER_FORCE_NO_UI
// If charger shouldn't have UI for your device, simply drop the line below
// for your service implementation. This corresponds to