Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6012db55 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

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: default avatarSandeep Patil <sspatil@google.com>
parent fca82440
Loading
Loading
Loading
Loading
+43 −4
Original line number Diff line number Diff line
@@ -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)
+1 −2
Original line number Diff line number Diff line
@@ -646,10 +646,9 @@ service ueventd /sbin/ueventd
    critical
    seclabel u:r:ueventd:s0

service healthd /sbin/healthd
service healthd /system/bin/healthd
    class core
    critical
    seclabel u:r:healthd:s0
    group root system wakelock

service console /system/bin/sh