healthd: refactor healthd code to split into 'charger' and 'healthd'

This splits healthd code into 2 pieces as described below.

charger - statically linked executable in /sbin
 - responsible for charger-mode UI
 - battery/charger  monitoring in recovery/charger-mode.

healthd - dynamically linked (*mostly*) executable in /system/bin
 - responsible for battery / charger monitoring in Android
 - runs 'batteryproperties' service.

Both currently use libhealthd STATIC HALs. However, this now paves
way for the healthd (android) HAL to be a shared library that can
be trebelized.

   text    data     bss     dec     hex filename
 733356   15312   33864  782532   bf0c4 root/sbin/charger
  55943   10392     192   66527   103df system/bin/healthd
 789299   25704   34056  849059   cf4a3 (TOTALS)

Test: Tested recovery, charge-only and android boot with new binaries
with and without STATIC HAL.

Change-Id: I80f94948dda44d466f172d234b3fcc9064ef2476
Signed-off-by: Sandeep Patil <sspatil@google.com>
diff --git a/healthd/Android.mk b/healthd/Android.mk
index 08475f3..5a6303e 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -88,7 +88,8 @@
 endif
 
 LOCAL_SRC_FILES := \
-	healthd.cpp
+    healthd_common.cpp \
+    charger.cpp \
 
 LOCAL_MODULE := charger
 LOCAL_MODULE_TAGS := optional
@@ -109,11 +110,8 @@
 endif
 
 LOCAL_STATIC_LIBRARIES := \
-    libhealthd_android \
     libhealthd_charger \
     libbatterymonitor \
-    libbatteryservice \
-    libbinder \
     libbase \
     libutils \
     libcutils \
@@ -173,7 +171,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-	healthd.cpp
+    healthd_common.cpp \
+    healthd.cpp \
 
 LOCAL_MODULE := healthd
 LOCAL_MODULE_TAGS := optional
@@ -188,7 +187,6 @@
 
 LOCAL_STATIC_LIBRARIES := \
     libhealthd_android \
-    libhealthd_charger \
     libbatterymonitor \
     libbatteryservice \
 
@@ -200,10 +198,6 @@
     liblog \
     libm \
     libc \
-    libminui \
-    libpng \
-    libz \
-    libsuspend \
 
 LOCAL_HAL_STATIC_LIBRARIES := libhealthd
 include $(BUILD_EXECUTABLE)