From 6012db553c87f4f4b039a7d42e3b80ce9480f20f Mon Sep 17 00:00:00 2001 From: Sandeep Patil Date: Tue, 1 Nov 2016 08:45:19 -0700 Subject: healthd: build 'charger' and 'healthd' binaries This renames the old '/sbin/healthd' to '/sbin/charger' which is to be only used in recovery and charger-only mode. .. and adds a new dynamically linked executable in /system/bin/healthd to be used as 'healthd' in Android. text data bss dec hex filename 817404 36704 37960 892068 d9ca4 root/sbin/charger {was healthd} 72717 11064 12984 96765 179fd system/bin/healthd {*new*} 890121 47768 50944 988833 f16a1 (TOTALS) Corresponding changes in recovery and charger-only .rc files are required change how 'charger' is launched in each mode. Update the seclable for healthd with the launch path in init.rc Test: Boot tested and verified all 3 modes (recovery, charge-only, android) Change-Id: I4ada27a4c113258c5be1fd10adb0f58232b10024 Signed-off-by: Sandeep Patil --- healthd/Android.mk | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'healthd') diff --git a/healthd/Android.mk b/healthd/Android.mk index 49873aab7..08475f311 100644 --- a/healthd/Android.mk +++ b/healthd/Android.mk @@ -78,6 +78,7 @@ endif include $(BUILD_STATIC_LIBRARY) +### charger ### include $(CLEAR_VARS) ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true) LOCAL_CHARGER_NO_UI := true @@ -89,7 +90,7 @@ endif LOCAL_SRC_FILES := \ healthd.cpp -LOCAL_MODULE := healthd +LOCAL_MODULE := charger LOCAL_MODULE_TAGS := optional LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) @@ -134,13 +135,12 @@ endif LOCAL_HAL_STATIC_LIBRARIES := libhealthd -# Symlink /charger to /sbin/healthd +# Symlink /charger to /sbin/charger LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \ - && ln -sf /sbin/healthd $(TARGET_ROOT_OUT)/charger + && ln -sf /sbin/charger $(TARGET_ROOT_OUT)/charger include $(BUILD_EXECUTABLE) - ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true) define _add-charger-image include $$(CLEAR_VARS) @@ -168,3 +168,42 @@ include $(BUILD_PHONY_PACKAGE) _add-charger-image := _img_modules := endif # LOCAL_CHARGER_NO_UI + +### healthd ### +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + healthd.cpp + +LOCAL_MODULE := healthd +LOCAL_MODULE_TAGS := optional +LOCAL_C_INCLUDES := $(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_android \ + libhealthd_charger \ + libbatterymonitor \ + libbatteryservice \ + +LOCAL_SHARED_LIBRARIES := \ + libbinder \ + libbase \ + libutils \ + libcutils \ + liblog \ + libm \ + libc \ + libminui \ + libpng \ + libz \ + libsuspend \ + +LOCAL_HAL_STATIC_LIBRARIES := libhealthd +include $(BUILD_EXECUTABLE) -- cgit v1.2.3