blob: 289afe99eb6f00e8061c6a0a626feac752fa33a3 [file] [log] [blame]
Todd Poynor752faf22013-06-12 13:25:59 -07001# Copyright 2013 The Android Open Source Project
2
Todd Poynor752faf22013-06-12 13:25:59 -07003LOCAL_PATH := $(call my-dir)
Todd Poynord65104c2013-08-13 15:50:42 -07004
Tao Baof2455d82018-09-07 12:52:46 -07005### libhealthd_draw ###
Todd Poynord65104c2013-08-13 15:50:42 -07006include $(CLEAR_VARS)
Sandeep Patilfca82442016-11-01 08:29:30 -07007
Luke Song1d540dd2017-07-13 15:10:35 -07008LOCAL_MODULE := libhealthd_draw
9
10LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Yifan Hong97eecdc2019-07-03 11:07:37 -070011LOCAL_STATIC_LIBRARIES := libcharger_sysprop libminui
Tao Baof2455d82018-09-07 12:52:46 -070012LOCAL_SHARED_LIBRARIES := libbase
Luke Song1d540dd2017-07-13 15:10:35 -070013LOCAL_SRC_FILES := healthd_draw.cpp
14
15ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_SCREEN),)
16LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=$(TARGET_HEALTHD_DRAW_SPLIT_SCREEN)
17else
18LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_SCREEN=0
19endif
20
21ifneq ($(TARGET_HEALTHD_DRAW_SPLIT_OFFSET),)
22LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=$(TARGET_HEALTHD_DRAW_SPLIT_OFFSET)
23else
24LOCAL_CFLAGS += -DHEALTHD_DRAW_SPLIT_OFFSET=0
25endif
26
Yifan Hong9a81d542018-05-04 13:53:41 -070027LOCAL_HEADER_LIBRARIES := libbatteryservice_headers
28
Luke Song1d540dd2017-07-13 15:10:35 -070029include $(BUILD_STATIC_LIBRARY)
30
Tao Baof2455d82018-09-07 12:52:46 -070031### libhealthd_charger ###
Luke Song1d540dd2017-07-13 15:10:35 -070032include $(CLEAR_VARS)
33
Sandeep Patilfca82442016-11-01 08:29:30 -070034LOCAL_CFLAGS := -Werror
35ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
36LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
37endif
38ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
39LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
40endif
41
42LOCAL_SRC_FILES := \
43 healthd_mode_charger.cpp \
44 AnimationParser.cpp
45
46LOCAL_MODULE := libhealthd_charger
Tao Baob6ccc782018-09-06 15:13:47 -070047LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Sandeep Patilfca82442016-11-01 08:29:30 -070048LOCAL_EXPORT_C_INCLUDE_DIRS := \
49 $(LOCAL_PATH) \
50 $(LOCAL_PATH)/include
51
52LOCAL_STATIC_LIBRARIES := \
Hridya Valsarajuffb13032017-12-11 17:32:22 -080053 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080054 android.hardware.health@1.0-convert \
Yifan Hong97eecdc2019-07-03 11:07:37 -070055 libcharger_sysprop \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080056 libhealthstoragedefault \
Tao Baof2455d82018-09-07 12:52:46 -070057 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070058 libminui \
Tao Baof2455d82018-09-07 12:52:46 -070059
60LOCAL_SHARED_LIBRARIES := \
61 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070062 libbase \
63 libcutils \
64 liblog \
Tao Baof2455d82018-09-07 12:52:46 -070065 libpng \
66 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070067
Sandeep Patilfca82442016-11-01 08:29:30 -070068ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Baof2455d82018-09-07 12:52:46 -070069LOCAL_SHARED_LIBRARIES += libsuspend
Sandeep Patilfca82442016-11-01 08:29:30 -070070endif
71
Damien Bargiacchi565ba022016-08-11 15:29:50 -070072include $(BUILD_STATIC_LIBRARY)
73
Sandeep Patil6012db52016-11-01 08:45:19 -070074### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070075include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080076ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
77LOCAL_CHARGER_NO_UI := true
78endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080079
Todd Poynor752faf22013-06-12 13:25:59 -070080LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070081 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080082
Sandeep Patil6012db52016-11-01 08:45:19 -070083LOCAL_MODULE := charger
Sandeep Patilfca82442016-11-01 08:29:30 -070084LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070085
Sandeep Patilfca82442016-11-01 08:29:30 -070086LOCAL_CFLAGS := -Werror
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070087
Yifan Hongb7cd45f2017-11-13 18:47:03 -080088CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080089 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080090 android.hardware.health@1.0-convert \
Jayant Chowdharyc2d39492018-10-01 22:50:07 +000091 libbinderthreadstate \
Yifan Hong97eecdc2019-07-03 11:07:37 -070092 libcharger_sysprop \
Yifan Hong10c2b402017-11-08 10:57:52 -080093 libhidltransport \
94 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -070095 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080096 libhealthstoragedefault \
Yifan Hong10c2b402017-11-08 10:57:52 -080097 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -070098 libhealthd_charger \
Tao Bao5747e222018-09-11 10:46:35 -070099 libhealthd_charger_nops \
Luke Song1d540dd2017-07-13 15:10:35 -0700100 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700101 libbatterymonitor \
Tao Baof2455d82018-09-07 12:52:46 -0700102
103CHARGER_SHARED_LIBRARIES := \
104 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700105 libbase \
106 libcutils \
Suren Baghdasaryan82b72a52018-12-21 11:41:50 -0800107 libjsoncpp \
Suren Baghdasaryan94910782019-01-25 05:32:52 +0000108 libprocessgroup \
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700109 liblog \
Tao Baof2455d82018-09-07 12:52:46 -0700110 libutils \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700111
Sandeep Patilfca82442016-11-01 08:29:30 -0700112ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Tao Bao5747e222018-09-11 10:46:35 -0700113CHARGER_STATIC_LIBRARIES += libminui
114CHARGER_SHARED_LIBRARIES += libpng
Sandeep Patilfca82442016-11-01 08:29:30 -0700115endif
116
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700117ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Bao5747e222018-09-11 10:46:35 -0700118CHARGER_SHARED_LIBRARIES += libsuspend
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700119endif
120
Tao Bao5747e222018-09-11 10:46:35 -0700121LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
122LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
123
Todd Poynord65104c2013-08-13 15:50:42 -0700124LOCAL_HAL_STATIC_LIBRARIES := libhealthd
Todd Poynor10b235e2013-08-07 15:25:14 -0700125
Tao Baof2455d82018-09-07 12:52:46 -0700126# Symlink /charger to /system/bin/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700127LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT) \
Tao Baof2455d82018-09-07 12:52:46 -0700128 && ln -sf /system/bin/charger $(TARGET_ROOT_OUT)/charger
Ying Wangc4d6ade2013-09-20 10:37:42 -0700129
Todd Poynor752faf22013-06-12 13:25:59 -0700130include $(BUILD_EXECUTABLE)
131
Tao Bao5747e222018-09-11 10:46:35 -0700132### charger.recovery ###
133include $(CLEAR_VARS)
134
135LOCAL_SRC_FILES := \
136 charger.cpp \
137
138LOCAL_MODULE := charger.recovery
139LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
140LOCAL_MODULE_STEM := charger
141
142LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -0700143LOCAL_CFLAGS := -Wall -Werror -DCHARGER_FORCE_NO_UI=1
Tao Bao5747e222018-09-11 10:46:35 -0700144
145# charger.recovery doesn't link against libhealthd_{charger,draw} or libminui, since it doesn't need
146# any UI support.
147LOCAL_STATIC_LIBRARIES := \
148 android.hardware.health@2.0-impl \
149 android.hardware.health@1.0-convert \
150 libbinderthreadstate \
Yifan Hong97eecdc2019-07-03 11:07:37 -0700151 libcharger_sysprop \
Tao Bao5747e222018-09-11 10:46:35 -0700152 libhidltransport \
153 libhidlbase \
154 libhwbinder_noltopgo \
155 libhealthstoragedefault \
156 libvndksupport \
157 libhealthd_charger_nops \
158 libbatterymonitor \
159
160# These shared libs will be installed to recovery image because of the dependency in `recovery`
161# module.
162LOCAL_SHARED_LIBRARIES := \
163 android.hardware.health@2.0 \
164 libbase \
165 libcutils \
166 liblog \
167 libutils \
168
169# The use of LOCAL_HAL_STATIC_LIBRARIES prevents from building this module with Android.bp.
170LOCAL_HAL_STATIC_LIBRARIES := libhealthd
171
172include $(BUILD_EXECUTABLE)
173
Tao Baof2455d82018-09-07 12:52:46 -0700174### charger_test ###
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800175include $(CLEAR_VARS)
176LOCAL_MODULE := charger_test
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800177LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Yifan Hong97eecdc2019-07-03 11:07:37 -0700178LOCAL_CFLAGS := -Wall -Werror
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800179LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700180LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800181LOCAL_SRC_FILES := \
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800182 charger_test.cpp \
183
184include $(BUILD_EXECUTABLE)
185
186CHARGER_STATIC_LIBRARIES :=
Tao Baof2455d82018-09-07 12:52:46 -0700187CHARGER_SHARED_LIBRARIES :=
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800188
Tao Baof2455d82018-09-07 12:52:46 -0700189### charger_res_images ###
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800190ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700191define _add-charger-image
192include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700193LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700194LOCAL_MODULE_STEM := $(notdir $(1))
195_img_modules += $$(LOCAL_MODULE)
196LOCAL_SRC_FILES := $1
197LOCAL_MODULE_TAGS := optional
198LOCAL_MODULE_CLASS := ETC
199LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
200include $$(BUILD_PREBUILT)
201endef
202
203_img_modules :=
204_images :=
205$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
206 $(eval $(call _add-charger-image,$(_img))))
207
208include $(CLEAR_VARS)
209LOCAL_MODULE := charger_res_images
210LOCAL_MODULE_TAGS := optional
211LOCAL_REQUIRED_MODULES := $(_img_modules)
212include $(BUILD_PHONY_PACKAGE)
213
214_add-charger-image :=
215_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800216endif # LOCAL_CHARGER_NO_UI