summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorSandeep Patil <sspatil@google.com>2016-11-01 08:29:30 -0700
committerSandeep Patil <sspatil@google.com>2016-11-08 07:35:55 -0800
commitfca824408006a34c1fdfa4c43237fb24076f324a (patch)
treefddc031d61d92181601c1e2e8b3fea4b96557716 /healthd
parent96c59d848a491c6b3aaaf2f78c17e9b54cd2071c (diff)
downloadcore-fca824408006a34c1fdfa4c43237fb24076f324a.tar.gz
core-fca824408006a34c1fdfa4c43237fb24076f324a.tar.bz2
core-fca824408006a34c1fdfa4c43237fb24076f324a.zip
healthd: refactor to split charger and framework facing code
The charger code lands in 'libhealthd_charger' and androoid/framework facing code is now compiled into 'libhealtdh_android' (formerly libhealthd_internal). This is a pre-cursor to eventually splitting healthd into 2 binaries, viz .. 1. /sbin/charger - statically linked binary to be used *only* in recovery and charge-only mode(s). 2. /system/bin/healthd - dynamically linked binary to be used *only* in Android. The static board hal (i.e libhealthd.<target>) will then be compiled twice for charger and healthd seperately, paving the way for us to seperate out the HAL for Android Test: Boot tested and verified 'healthd' works in recovery, charger-only mode and Android. Change-Id: If45213ddd14c00ea3b8e1759cfd99286ca1ef2ea Signed-off-by: Sandeep Patil <sspatil@google.com>
Diffstat (limited to 'healthd')
-rw-r--r--healthd/Android.mk93
1 files changed, 48 insertions, 45 deletions
diff --git a/healthd/Android.mk b/healthd/Android.mk
index b292725b9..49873aab7 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -21,26 +21,47 @@ LOCAL_STATIC_LIBRARIES := libutils libbase libbinder
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
+LOCAL_SRC_FILES := \
+ healthd_mode_android.cpp \
+ BatteryPropertiesRegistrar.cpp
+
+LOCAL_MODULE := libhealthd_android
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH) \
+ $(LOCAL_PATH)/include
+
+LOCAL_STATIC_LIBRARIES := \
+ libbatterymonitor \
+ libbatteryservice \
+ libutils \
+ libbase \
+ libcutils \
+ liblog \
+ libc \
+
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS := -Werror
+ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
+LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
+endif
ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
-LOCAL_SHARED_LIBRARIES += libsuspend
endif
+
LOCAL_SRC_FILES := \
- healthd_mode_android.cpp \
healthd_mode_charger.cpp \
- AnimationParser.cpp \
- BatteryPropertiesRegistrar.cpp \
+ AnimationParser.cpp
-LOCAL_MODULE := libhealthd_internal
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_MODULE := libhealthd_charger
+LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
- $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := \
- libbatterymonitor \
- libbatteryservice \
- libbinder \
libminui \
libpng \
libz \
@@ -51,11 +72,13 @@ LOCAL_STATIC_LIBRARIES := \
libm \
libc \
-include $(BUILD_STATIC_LIBRARY)
+ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
+LOCAL_STATIC_LIBRARIES += libsuspend
+endif
+include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
-
ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
LOCAL_CHARGER_NO_UI := true
endif
@@ -64,67 +87,47 @@ LOCAL_CHARGER_NO_UI := true
endif
LOCAL_SRC_FILES := \
- healthd.cpp \
- healthd_mode_android.cpp \
- BatteryPropertiesRegistrar.cpp \
-
-ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
-LOCAL_SRC_FILES += healthd_mode_charger.cpp
-endif
+ healthd.cpp
LOCAL_MODULE := healthd
LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
-
-ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
-LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
-endif
-
-ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
-LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
-endif
-
+LOCAL_CFLAGS := -Werror
ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
LOCAL_CFLAGS += -DCHARGER_NO_UI
endif
-
-LOCAL_C_INCLUDES := bootable/recovery $(LOCAL_PATH)/include
-
ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
endif
-
ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
endif
LOCAL_STATIC_LIBRARIES := \
- libhealthd_internal \
+ libhealthd_android \
+ libhealthd_charger \
libbatterymonitor \
libbatteryservice \
libbinder \
libbase \
-
-ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
-LOCAL_STATIC_LIBRARIES += \
- libminui \
- libpng \
- libz \
-
-endif
-
-
-LOCAL_STATIC_LIBRARIES += \
libutils \
libcutils \
liblog \
libm \
libc \
+ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
+LOCAL_STATIC_LIBRARIES += \
+ libminui \
+ libpng \
+ libz \
+
+endif
+
ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
LOCAL_STATIC_LIBRARIES += libsuspend
endif