blob: 020a7448712e7501c58e03e3cceedff5ca7db4d0 [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",
170 "libhealth2impl",
171 "libhealthd_charger_ui",
172 ],
173
174 shared_libs: [
175 "android.hardware.health@2.1",
176 "libbase",
177 "libcutils",
178 "liblog",
179 "libutils",
180 ],
181
182 srcs: [
183 "healthd_mode_charger_hidl.cpp",
184 ],
185}
186
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700187cc_defaults {
188 name: "charger_defaults",
Yifan Hongb5d70332021-10-20 17:15:32 -0700189 local_include_dirs: [
190 "include_charger",
191 ],
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700192
193 cflags: [
194 "-Wall",
195 "-Werror",
196 ],
197
198 shared_libs: [
199 // common
200 "android.hardware.health@2.0",
201 "android.hardware.health@2.1",
202 "libbase",
203 "libcutils",
204 "libhidlbase",
205 "liblog",
206 "libutils",
207
208 // system charger only
209 "libpng",
210 ],
211
212 static_libs: [
213 // common
214 "android.hardware.health@1.0-convert",
Yifan Hongb5d70332021-10-20 17:15:32 -0700215 "android.hardware.health-V1-ndk",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700216 "libbatterymonitor",
217 "libcharger_sysprop",
218 "libhealthd_charger_nops",
219 "libhealthloop",
220 "libhealth2impl",
221
222 // system charger only
223 "libhealthd_draw",
224 "libhealthd_charger",
Yifan Hongb5d70332021-10-20 17:15:32 -0700225 "libhealthd_charger_ui",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700226 "libminui",
227 "libsuspend",
228 ],
229}
230
231cc_binary {
232 name: "charger",
233 defaults: ["charger_defaults"],
234 recovery_available: true,
235 srcs: [
236 "charger.cpp",
237 "charger_utils.cpp",
238 ],
239
240 target: {
241 recovery: {
242 // No UI and libsuspend for recovery charger.
243 cflags: [
244 "-DCHARGER_FORCE_NO_UI=1",
245 ],
246 exclude_shared_libs: [
247 "libpng",
248 ],
249 exclude_static_libs: [
250 "libhealthd_draw",
251 "libhealthd_charger",
Yifan Hongb5d70332021-10-20 17:15:32 -0700252 "libhealthd_charger_ui",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700253 "libminui",
254 "libsuspend",
255 ],
256 }
257 }
258}
259
260cc_test {
261 name: "charger_test",
262 defaults: ["charger_defaults"],
263 srcs: ["charger_test.cpp"],
264}
Yifan Hong12d15752020-08-05 16:25:33 -0700265
266cc_test {
267 name: "libhealthd_charger_test",
Yifan Hongc2bed972020-08-07 16:27:49 -0700268 defaults: ["charger_defaults"],
269 srcs: [
270 "AnimationParser_test.cpp",
271 "healthd_mode_charger_test.cpp"
Yifan Hong12d15752020-08-05 16:25:33 -0700272 ],
273 static_libs: [
Yifan Hongc2bed972020-08-07 16:27:49 -0700274 "libgmock",
Yifan Hong12d15752020-08-05 16:25:33 -0700275 ],
Yifan Hong186b4d92020-08-05 16:30:43 -0700276 test_suites: [
277 "general-tests",
278 "device-tests",
279 ],
Yifan Hongc2bed972020-08-07 16:27:49 -0700280 data: [
281 ":libhealthd_charger_test_data",
282 ],
283 require_root: true,
Yifan Hong12d15752020-08-05 16:25:33 -0700284}
Yifan Hong5109c8c2020-08-05 18:24:25 -0700285
286// /system/etc/res/images/charger/battery_fail.png
287prebuilt_etc {
288 name: "system_core_charger_res_images_battery_fail.png",
289 src: "images/battery_fail.png",
290 relative_install_path: "res/images/charger",
291 filename: "battery_fail.png",
292}
293
294// /system/etc/res/images/charger/battery_scale.png
295prebuilt_etc {
296 name: "system_core_charger_res_images_battery_scale.png",
297 src: "images/battery_scale.png",
298 relative_install_path: "res/images/charger",
299 filename: "battery_scale.png",
300}
301
302phony {
303 name: "charger_res_images",
304 required: [
305 "system_core_charger_res_images_battery_fail.png",
306 "system_core_charger_res_images_battery_scale.png",
307 ],
308}