healthd: move Android communication code to separate source

* add ops for different "modes" of healthd operation: android vs. recovery
* recovery mode selected by runstring options -r
* binder/Android communication moved to android mode
* recovery mode ops avoiding binder service registration
* "no service manager" flag removed; now handled by android vs. other modes

Change-Id: I3d8c89bf96a18a6a00cc85306f9a07d3f408f2a0
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 424d180..f641077 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -18,7 +18,6 @@
 
 #include "healthd.h"
 #include "BatteryMonitor.h"
-#include "BatteryPropertiesRegistrar.h"
 
 #include <dirent.h>
 #include <errno.h>
@@ -266,9 +265,7 @@
                   props.chargerWirelessOnline ? "w" : "");
     }
 
-    if (mBatteryPropertiesRegistrar != NULL)
-        mBatteryPropertiesRegistrar->notifyListeners(props);
-
+    healthd_mode_ops->battery_update(&props);
     return props.chargerAcOnline | props.chargerUsbOnline |
             props.chargerWirelessOnline;
 }
@@ -317,7 +314,7 @@
     return ret;
 }
 
-void BatteryMonitor::init(struct healthd_config *hc, bool nosvcmgr) {
+void BatteryMonitor::init(struct healthd_config *hc) {
     String8 path;
 
     mHealthdConfig = hc;
@@ -467,11 +464,6 @@
         KLOG_WARNING(LOG_TAG, "BatteryTemperaturePath not found\n");
     if (mHealthdConfig->batteryTechnologyPath.isEmpty())
         KLOG_WARNING(LOG_TAG, "BatteryTechnologyPath not found\n");
-
-    if (nosvcmgr == false) {
-            mBatteryPropertiesRegistrar = new BatteryPropertiesRegistrar();
-            mBatteryPropertiesRegistrar->publish();
-    }
 }
 
 }; // namespace android