blob: 42b1c232011399e99dabf12b2ba99d16ced26ad1 [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)
Tao Baof2455d82018-09-07 12:52:46 -070011LOCAL_STATIC_LIBRARIES := libminui
12LOCAL_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 \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080055 libhealthstoragedefault \
Tao Baof2455d82018-09-07 12:52:46 -070056 libhealthd_draw \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070057 libminui \
Tao Baof2455d82018-09-07 12:52:46 -070058
59LOCAL_SHARED_LIBRARIES := \
60 android.hardware.health@2.0 \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070061 libbase \
62 libcutils \
63 liblog \
Tao Baof2455d82018-09-07 12:52:46 -070064 libpng \
65 libutils \
Damien Bargiacchi565ba022016-08-11 15:29:50 -070066
Sandeep Patilfca82442016-11-01 08:29:30 -070067ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Baof2455d82018-09-07 12:52:46 -070068LOCAL_SHARED_LIBRARIES += libsuspend
Sandeep Patilfca82442016-11-01 08:29:30 -070069endif
70
Damien Bargiacchi565ba022016-08-11 15:29:50 -070071include $(BUILD_STATIC_LIBRARY)
72
Sandeep Patil6012db52016-11-01 08:45:19 -070073### charger ###
Damien Bargiacchi565ba022016-08-11 15:29:50 -070074include $(CLEAR_VARS)
Todd Poynor7c5a3e12016-02-12 19:53:15 -080075ifeq ($(strip $(BOARD_CHARGER_NO_UI)),true)
76LOCAL_CHARGER_NO_UI := true
77endif
Todd Poynor7c5a3e12016-02-12 19:53:15 -080078
Todd Poynor752faf22013-06-12 13:25:59 -070079LOCAL_SRC_FILES := \
Sandeep Patil526f8cf2016-11-01 16:41:56 -070080 charger.cpp \
Todd Poynor7c5a3e12016-02-12 19:53:15 -080081
Sandeep Patil6012db52016-11-01 08:45:19 -070082LOCAL_MODULE := charger
Sandeep Patilfca82442016-11-01 08:29:30 -070083LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Todd Poynor752faf22013-06-12 13:25:59 -070084
Sandeep Patilfca82442016-11-01 08:29:30 -070085LOCAL_CFLAGS := -Werror
Todd Poynor7c5a3e12016-02-12 19:53:15 -080086ifeq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
87LOCAL_CFLAGS += -DCHARGER_NO_UI
88endif
Nick Vaccaro1f1a6fd2016-10-21 19:16:40 -070089
Yifan Hongb7cd45f2017-11-13 18:47:03 -080090CHARGER_STATIC_LIBRARIES := \
Yifan Hong10c2b402017-11-08 10:57:52 -080091 android.hardware.health@2.0-impl \
Hridya Valsaraju7fa72252018-01-12 17:44:33 -080092 android.hardware.health@1.0-convert \
Jayant Chowdharyc2d39492018-10-01 22:50:07 +000093 libbinderthreadstate \
Yifan Hong10c2b402017-11-08 10:57:52 -080094 libhidltransport \
95 libhidlbase \
Pirama Arumuga Nainar9dddfbc2018-04-09 10:40:06 -070096 libhwbinder_noltopgo \
Hridya Valsaraju89178e72018-01-10 16:14:28 -080097 libhealthstoragedefault \
Yifan Hong10c2b402017-11-08 10:57:52 -080098 libvndksupport \
Sandeep Patilfca82442016-11-01 08:29:30 -070099 libhealthd_charger \
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 libpng \
111 libutils \
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700112
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800113LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700114LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800115
Sandeep Patilfca82442016-11-01 08:29:30 -0700116ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Tao Baof2455d82018-09-07 12:52:46 -0700117LOCAL_STATIC_LIBRARIES += libminui
Sandeep Patilfca82442016-11-01 08:29:30 -0700118endif
119
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700120ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
Tao Baof2455d82018-09-07 12:52:46 -0700121LOCAL_SHARED_LIBRARIES += libsuspend
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700122endif
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 Baof2455d82018-09-07 12:52:46 -0700132### charger_test ###
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800133include $(CLEAR_VARS)
134LOCAL_MODULE := charger_test
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800135LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
136LOCAL_CFLAGS := -Wall -Werror -DCHARGER_TEST -DCHARGER_NO_UI
137LOCAL_STATIC_LIBRARIES := $(CHARGER_STATIC_LIBRARIES)
Tao Baof2455d82018-09-07 12:52:46 -0700138LOCAL_SHARED_LIBRARIES := $(CHARGER_SHARED_LIBRARIES)
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800139LOCAL_SRC_FILES := \
140 charger.cpp \
141 charger_test.cpp \
142
143include $(BUILD_EXECUTABLE)
144
145CHARGER_STATIC_LIBRARIES :=
Tao Baof2455d82018-09-07 12:52:46 -0700146CHARGER_SHARED_LIBRARIES :=
Yifan Hongb7cd45f2017-11-13 18:47:03 -0800147
Tao Baof2455d82018-09-07 12:52:46 -0700148### charger_res_images ###
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800149ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700150define _add-charger-image
151include $$(CLEAR_VARS)
Damien Bargiacchi565ba022016-08-11 15:29:50 -0700152LOCAL_MODULE := system_core_charger_res_images_$(notdir $(1))
Todd Poynorfea5b4d2013-09-09 12:09:08 -0700153LOCAL_MODULE_STEM := $(notdir $(1))
154_img_modules += $$(LOCAL_MODULE)
155LOCAL_SRC_FILES := $1
156LOCAL_MODULE_TAGS := optional
157LOCAL_MODULE_CLASS := ETC
158LOCAL_MODULE_PATH := $$(TARGET_ROOT_OUT)/res/images/charger
159include $$(BUILD_PREBUILT)
160endef
161
162_img_modules :=
163_images :=
164$(foreach _img, $(call find-subdir-subdir-files, "images", "*.png"), \
165 $(eval $(call _add-charger-image,$(_img))))
166
167include $(CLEAR_VARS)
168LOCAL_MODULE := charger_res_images
169LOCAL_MODULE_TAGS := optional
170LOCAL_REQUIRED_MODULES := $(_img_modules)
171include $(BUILD_PHONY_PACKAGE)
172
173_add-charger-image :=
174_img_modules :=
Todd Poynor7c5a3e12016-02-12 19:53:15 -0800175endif # LOCAL_CHARGER_NO_UI