blob: 15f009e93b13c03d4c26f755e0b9b46c78656e4a [file] [log] [blame]
Bob Badourd69ad692021-02-16 19:02:14 -08001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
Steven Moreland1b13eea2017-07-10 16:05:51 -07005cc_library_headers {
6 name: "libhealthd_headers",
7 vendor_available: true,
Yifan Hong90fdc722018-07-10 13:02:18 -07008 recovery_available: true,
Steven Moreland1b13eea2017-07-10 16:05:51 -07009 export_include_dirs: ["include"],
10 header_libs: ["libbatteryservice_headers"],
11 export_header_lib_headers: ["libbatteryservice_headers"],
12}
Yifan Hongffff9aa2017-06-01 14:34:29 -070013
14cc_library_static {
15 name: "libbatterymonitor",
16 srcs: ["BatteryMonitor.cpp"],
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080017 cflags: ["-Wall", "-Werror"],
Yifan Hongffff9aa2017-06-01 14:34:29 -070018 vendor_available: true,
Yifan Hong90fdc722018-07-10 13:02:18 -070019 recovery_available: true,
Yifan Hongffff9aa2017-06-01 14:34:29 -070020 export_include_dirs: ["include"],
21 shared_libs: [
22 "libutils",
23 "libbase",
Yifan Hong1d4368b2019-10-07 11:18:04 -070024
25 // Need latest HealthInfo definition from headers of this shared
26 // library. Clients don't need to link to this.
27 "android.hardware.health@2.1",
Yifan Hongffff9aa2017-06-01 14:34:29 -070028 ],
29 header_libs: ["libhealthd_headers"],
30 export_header_lib_headers: ["libhealthd_headers"],
31}
Yifan Hong2763df82017-09-19 17:57:50 -070032
Yifan Hong1cf853f2018-04-04 14:08:57 -070033cc_defaults {
34 name: "android.hardware.health@2.0-service_defaults",
Yifan Hong2763df82017-09-19 17:57:50 -070035
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080036 cflags: [
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080037 "-Wall",
38 "-Werror",
39 ],
Yifan Hong2763df82017-09-19 17:57:50 -070040
41 static_libs: [
42 "android.hardware.health@2.0-impl",
43 "android.hardware.health@1.0-convert",
Yifan Hongaffa24f2018-01-19 15:53:25 -080044 "libhealthservice",
Hridya Valsaraju89178e72018-01-10 16:14:28 -080045 "libhealthstoragedefault",
Yifan Hong2763df82017-09-19 17:57:50 -070046 "libbatterymonitor",
47 ],
48
49 shared_libs: [
50 "libbase",
51 "libcutils",
52 "libhidlbase",
Yifan Hong2763df82017-09-19 17:57:50 -070053 "liblog",
54 "libutils",
55 "android.hardware.health@2.0",
56 ],
57}
Yifan Hong12df1b92017-09-25 17:25:00 -070058
59cc_binary {
Yifan Hong1cf853f2018-04-04 14:08:57 -070060 name: "android.hardware.health@2.0-service",
61 defaults: ["android.hardware.health@2.0-service_defaults"],
Yifan Hong31150c12018-05-01 14:59:43 -070062
Yifan Hongef26fe42018-07-10 13:07:08 -070063 vendor: true,
64 relative_install_path: "hw",
65 init_rc: ["android.hardware.health@2.0-service.rc"],
66 srcs: [
67 "HealthServiceDefault.cpp",
68 ],
Yifan Hong12df1b92017-09-25 17:25:00 -070069}
Tao Bao5747e222018-09-11 10:46:35 -070070
71cc_library_static {
72 name: "libhealthd_charger_nops",
Yifan Hong7dcf7b02019-10-08 17:27:11 -070073 recovery_available: true,
Tao Bao5747e222018-09-11 10:46:35 -070074
75 srcs: [
76 "healthd_mode_charger_nops.cpp",
77 ],
78
79 cflags: [
80 "-Wall",
81 "-Werror",
82 ],
83
84 header_libs: [
85 "libhealthd_headers",
86 ],
87
88 static_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -070089 "libhealthloop",
90 "libhealth2impl",
Tao Bao5747e222018-09-11 10:46:35 -070091 ],
92
93 shared_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -070094 "android.hardware.health@2.1",
Tao Bao5747e222018-09-11 10:46:35 -070095 "libutils",
96 ],
97}
Yifan Hong97eecdc2019-07-03 11:07:37 -070098
99sysprop_library {
100 name: "charger_sysprop",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700101 recovery_available: true,
Yifan Hong97eecdc2019-07-03 11:07:37 -0700102 srcs: ["charger.sysprop"],
103 property_owner: "Platform",
104 api_packages: ["android.sysprop"],
105}
Yifan Hongdbaa4772019-07-03 11:40:08 -0700106
107cc_library_static {
108 name: "libhealthd_draw",
109 export_include_dirs: ["."],
110 static_libs: [
111 "libcharger_sysprop",
112 "libminui",
113 ],
114 shared_libs: [
115 "libbase",
116 ],
117 header_libs: ["libbatteryservice_headers"],
118
119 srcs: ["healthd_draw.cpp"],
120}
121
122cc_library_static {
Yifan Hongb5d70332021-10-20 17:15:32 -0700123 name: "libhealthd_charger_ui",
124 export_include_dirs: [
125 "include",
126 "include_charger",
127 ],
Yifan Hongdbaa4772019-07-03 11:40:08 -0700128
129 static_libs: [
Yifan Hongb5d70332021-10-20 17:15:32 -0700130 "android.hardware.health-V1-ndk",
131 "android.hardware.health-translate-ndk",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700132 "libcharger_sysprop",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700133 "libhealthd_draw",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700134 "libhealthloop",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700135 "libminui",
136 ],
137
138 shared_libs: [
Yifan Hongdbaa4772019-07-03 11:40:08 -0700139 "libbase",
140 "libcutils",
141 "liblog",
142 "libpng",
143 "libsuspend",
144 "libutils",
145 ],
146
Yifan Hongb5d70332021-10-20 17:15:32 -0700147 header_libs: [
148 "libhealthd_headers",
149 ],
150
151 export_static_lib_headers: [
152 "android.hardware.health-V1-ndk",
153 ],
154
Yifan Hongdbaa4772019-07-03 11:40:08 -0700155 srcs: [
156 "healthd_mode_charger.cpp",
157 "AnimationParser.cpp",
158 ],
159}
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700160
Yifan Hongb5d70332021-10-20 17:15:32 -0700161cc_library_static {
162 name: "libhealthd_charger",
163 export_include_dirs: [
164 "include",
165 "include_charger",
166 ],
167
168 static_libs: [
169 "android.hardware.health@1.0-convert",
Yifan Hong8e551342021-10-26 22:51:29 -0700170 "libcharger_sysprop",
Yifan Hongb5d70332021-10-20 17:15:32 -0700171 "libhealth2impl",
172 "libhealthd_charger_ui",
173 ],
174
175 shared_libs: [
176 "android.hardware.health@2.1",
177 "libbase",
178 "libcutils",
179 "liblog",
180 "libutils",
181 ],
182
183 srcs: [
184 "healthd_mode_charger_hidl.cpp",
185 ],
186}
187
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700188cc_defaults {
189 name: "charger_defaults",
Yifan Hongb5d70332021-10-20 17:15:32 -0700190 local_include_dirs: [
191 "include_charger",
192 ],
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700193
194 cflags: [
195 "-Wall",
196 "-Werror",
197 ],
198
199 shared_libs: [
200 // common
201 "android.hardware.health@2.0",
202 "android.hardware.health@2.1",
203 "libbase",
204 "libcutils",
205 "libhidlbase",
206 "liblog",
207 "libutils",
208
209 // system charger only
210 "libpng",
211 ],
212
213 static_libs: [
214 // common
215 "android.hardware.health@1.0-convert",
Yifan Hongb5d70332021-10-20 17:15:32 -0700216 "android.hardware.health-V1-ndk",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700217 "libbatterymonitor",
218 "libcharger_sysprop",
219 "libhealthd_charger_nops",
220 "libhealthloop",
221 "libhealth2impl",
222
223 // system charger only
224 "libhealthd_draw",
225 "libhealthd_charger",
Yifan Hongb5d70332021-10-20 17:15:32 -0700226 "libhealthd_charger_ui",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700227 "libminui",
228 "libsuspend",
229 ],
230}
231
232cc_binary {
233 name: "charger",
234 defaults: ["charger_defaults"],
235 recovery_available: true,
236 srcs: [
237 "charger.cpp",
238 "charger_utils.cpp",
239 ],
240
241 target: {
242 recovery: {
243 // No UI and libsuspend for recovery charger.
244 cflags: [
245 "-DCHARGER_FORCE_NO_UI=1",
246 ],
247 exclude_shared_libs: [
248 "libpng",
249 ],
250 exclude_static_libs: [
251 "libhealthd_draw",
252 "libhealthd_charger",
Yifan Hongb5d70332021-10-20 17:15:32 -0700253 "libhealthd_charger_ui",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700254 "libminui",
255 "libsuspend",
256 ],
257 }
258 }
259}
260
261cc_test {
262 name: "charger_test",
263 defaults: ["charger_defaults"],
264 srcs: ["charger_test.cpp"],
265}
Yifan Hong12d15752020-08-05 16:25:33 -0700266
267cc_test {
268 name: "libhealthd_charger_test",
Yifan Hongc2bed972020-08-07 16:27:49 -0700269 defaults: ["charger_defaults"],
270 srcs: [
271 "AnimationParser_test.cpp",
272 "healthd_mode_charger_test.cpp"
Yifan Hong12d15752020-08-05 16:25:33 -0700273 ],
274 static_libs: [
Yifan Hongc2bed972020-08-07 16:27:49 -0700275 "libgmock",
Yifan Hong12d15752020-08-05 16:25:33 -0700276 ],
Yifan Hong186b4d92020-08-05 16:30:43 -0700277 test_suites: [
278 "general-tests",
279 "device-tests",
280 ],
Yifan Hongc2bed972020-08-07 16:27:49 -0700281 data: [
282 ":libhealthd_charger_test_data",
283 ],
284 require_root: true,
Yifan Hong12d15752020-08-05 16:25:33 -0700285}
Yifan Hong5109c8c2020-08-05 18:24:25 -0700286
287// /system/etc/res/images/charger/battery_fail.png
288prebuilt_etc {
289 name: "system_core_charger_res_images_battery_fail.png",
290 src: "images/battery_fail.png",
291 relative_install_path: "res/images/charger",
292 filename: "battery_fail.png",
293}
294
295// /system/etc/res/images/charger/battery_scale.png
296prebuilt_etc {
297 name: "system_core_charger_res_images_battery_scale.png",
298 src: "images/battery_scale.png",
299 relative_install_path: "res/images/charger",
300 filename: "battery_scale.png",
301}
302
303phony {
304 name: "charger_res_images",
305 required: [
306 "system_core_charger_res_images_battery_fail.png",
307 "system_core_charger_res_images_battery_scale.png",
308 ],
309}