2013-06-13 04:25:59 +08:00
|
|
|
# Copyright 2013 The Android Open Source Project
|
|
|
|
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
2013-08-14 06:50:42 +08:00
|
|
|
|
2016-11-01 23:45:19 +08:00
|
|
|
### charger ###
|
2013-06-13 04:25:59 +08:00
|
|
|
include $(CLEAR_VARS)
|
2016-02-13 11:53:15 +08:00
|
|
|
ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
|
|
|
|
LOCAL_CHARGER_NO_UI := true
|
|
|
|
endif
|
|
|
|
|
2013-06-13 04:25:59 +08:00
|
|
|
LOCAL_SRC_FILES := \
|
2016-11-02 07:41:56 +08:00
|
|
|
charger.cpp \
|
2016-02-13 11:53:15 +08:00
|
|
|
|
2016-11-01 23:45:19 +08:00
|
|
|
LOCAL_MODULE := charger
|
2016-11-01 23:29:30 +08:00
|
|
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
2013-06-13 04:25:59 +08:00
|
|
|
|
2016-11-01 23:29:30 +08:00
|
|
|
LOCAL_CFLAGS := -Werror
|
2016-10-22 10:16:40 +08:00
|
|
|
|
2017-11-14 10:47:03 +08:00
|
|
|
CHARGER_STATIC_LIBRARIES := \
|
2017-11-09 02:57:52 +08:00
|
|
|
android.hardware.health@2.0-impl \
|
2018-01-13 09:44:33 +08:00
|
|
|
android.hardware.health@1.0-convert \
|
2018-10-02 06:50:07 +08:00
|
|
|
libbinderthreadstate \
|
2019-07-04 02:07:37 +08:00
|
|
|
libcharger_sysprop \
|
2017-11-09 02:57:52 +08:00
|
|
|
libhidltransport \
|
|
|
|
libhidlbase \
|
2018-04-10 01:40:06 +08:00
|
|
|
libhwbinder_noltopgo \
|
2018-01-11 08:14:28 +08:00
|
|
|
libhealthstoragedefault \
|
2019-07-04 02:40:08 +08:00
|
|
|
libminui \
|
2017-11-09 02:57:52 +08:00
|
|
|
libvndksupport \
|
2016-11-01 23:29:30 +08:00
|
|
|
libhealthd_charger \
|
2018-09-12 01:46:35 +08:00
|
|
|
libhealthd_charger_nops \
|
2017-07-14 06:10:35 +08:00
|
|
|
libhealthd_draw \
|
2016-08-12 06:29:50 +08:00
|
|
|
libbatterymonitor \
|
2018-09-08 03:52:46 +08:00
|
|
|
|
|
|
|
CHARGER_SHARED_LIBRARIES := \
|
|
|
|
android.hardware.health@2.0 \
|
2016-08-12 06:29:50 +08:00
|
|
|
libbase \
|
|
|
|
libcutils \
|
2018-12-22 03:41:50 +08:00
|
|
|
libjsoncpp \
|
2019-07-04 02:40:08 +08:00
|
|
|
libpng \
|
2019-01-25 13:32:52 +08:00
|
|
|
libprocessgroup \
|
2016-08-12 06:29:50 +08:00
|
|
|
liblog \
|
2018-09-08 03:52:46 +08:00
|
|
|
libutils \
|
2013-09-10 03:09:08 +08:00
|
|
|
|
2018-09-12 01:46:35 +08:00
|
|
|
CHARGER_SHARED_LIBRARIES += libsuspend
|
2013-09-10 03:09:08 +08:00
|
|
|
|
2018-09-12 01:46:35 +08:00
|
|
|
LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
|
|
|
|
LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
|
|
|
|
|
2013-08-14 06:50:42 +08:00
|
|
|
LOCAL_HAL_STATIC_LIBRARIES := libhealthd
|
2013-08-08 06:25:14 +08:00
|
|
|
|
2018-09-08 03:52:46 +08:00
|
|
|
# Symlink /charger to /system/bin/charger
|
2013-09-21 01:37:42 +08:00
|
|
|
LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
|
2018-09-08 03:52:46 +08:00
|
|
|
&& ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger
|
2013-09-10 03:09:08 +08:00
|
|
|
|
2013-09-21 01:37:42 +08:00
|
|
|
include $(BUILD_EXECUTABLE)
|
2013-09-10 03:09:08 +08:00
|
|
|
|
2018-09-12 01:46:35 +08:00
|
|
|
### charger.recovery ###
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
charger.cpp \
|
|
|
|
|
|
|
|
LOCAL_MODULE := charger.recovery
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
|
|
|
|
LOCAL_MODULE_STEM := charger
|
|
|
|
|
|
|
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
2019-07-04 02:07:37 +08:00
|
|
|
LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1
|
2018-09-12 01:46:35 +08:00
|
|
|
|
|
|
|
# charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
|
|
|
|
# any UI support.
|
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
|
|
|
android.hardware.health@2.0-impl \
|
|
|
|
android.hardware.health@1.0-convert \
|
|
|
|
libbinderthreadstate \
|
2019-07-04 02:07:37 +08:00
|
|
|
libcharger_sysprop \
|
2018-09-12 01:46:35 +08:00
|
|
|
libhidltransport \
|
|
|
|
libhidlbase \
|
|
|
|
libhwbinder_noltopgo \
|
|
|
|
libhealthstoragedefault \
|
|
|
|
libvndksupport \
|
|
|
|
libhealthd_charger_nops \
|
|
|
|
libbatterymonitor \
|
|
|
|
|
|
|
|
# These shared libs will be installed to recovery image because of the dependency in `recovery`
|
|
|
|
# module.
|
|
|
|
LOCAL_SHARED_LIBRARIES := \
|
|
|
|
android.hardware.health@2.0 \
|
|
|
|
libbase \
|
|
|
|
libcutils \
|
|
|
|
liblog \
|
|
|
|
libutils \
|
|
|
|
|
|
|
|
# The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp.
|
|
|
|
LOCAL_HAL_STATIC_LIBRARIES := libhealthd
|
|
|
|
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
2018-09-08 03:52:46 +08:00
|
|
|
### charger_test ###
|
2017-11-14 10:47:03 +08:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := charger_test
|
|
|
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
2019-07-04 02:07:37 +08:00
|
|
|
LOCAL_CFLAGS := -Wall -Werror
|
2017-11-14 10:47:03 +08:00
|
|
|
LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
|
2018-09-08 03:52:46 +08:00
|
|
|
LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
|
2017-11-14 10:47:03 +08:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
charger_test.cpp \
|
|
|
|
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
|
|
|
CHARGER_STATIC_LIBRARIES :=
|
2018-09-08 03:52:46 +08:00
|
|
|
CHARGER_SHARED_LIBRARIES :=
|
2017-11-14 10:47:03 +08:00
|
|
|
|
2018-09-08 03:52:46 +08:00
|
|
|
### charger_res_images ###
|
2016-02-13 11:53:15 +08:00
|
|
|
ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
|
2013-09-10 03:09:08 +08:00
|
|
|
define _add-charger-image
|
|
|
|
include $$(CLEAR_VARS)
|
2016-08-12 06:29:50 +08:00
|
|
|
LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
|
2013-09-10 03:09:08 +08:00
|
|
|
LOCAL_MODULE_STEM := $(notdir $(1))
|
|
|
|
_img_modules += $$(LOCAL_MODULE)
|
|
|
|
LOCAL_SRC_FILES := $1
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_MODULE_CLASS := ETC
|
|
|
|
LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
|
|
|
|
include $$(BUILD_PREBUILT)
|
|
|
|
endef
|
|
|
|
|
|
|
|
_img_modules :=
|
|
|
|
_images :=
|
|
|
|
$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
|
|
|
|
$(eval $(call _add-charger-image,$(_img))))
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := charger_res_images
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
LOCAL_REQUIRED_MODULES := $(_img_modules)
|
|
|
|
include $(BUILD_PHONY_PACKAGE)
|
|
|
|
|
|
|
|
_add-charger-image :=
|
|
|
|
_img_modules :=
|
2016-02-13 11:53:15 +08:00
|
|
|
endif # LOCAL_CHARGER_NO_UI
|