blob: 251a45bf00d6f1385887a1cbd9916db216051490 [file] [log] [blame]
Steven Moreland1b13eea2017-07-10 16:05:51 -07001cc_library_headers {
2 name: "libhealthd_headers",
3 vendor_available: true,
Yifan Hong90fdc722018-07-10 13:02:18 -07004 recovery_available: true,
Steven Moreland1b13eea2017-07-10 16:05:51 -07005 export_include_dirs: ["include"],
6 header_libs: ["libbatteryservice_headers"],
7 export_header_lib_headers: ["libbatteryservice_headers"],
8}
Yifan Hongffff9aa2017-06-01 14:34:29 -07009
10cc_library_static {
11 name: "libbatterymonitor",
12 srcs: ["BatteryMonitor.cpp"],
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080013 cflags: ["-Wall", "-Werror"],
Yifan Hongffff9aa2017-06-01 14:34:29 -070014 vendor_available: true,
Yifan Hong90fdc722018-07-10 13:02:18 -070015 recovery_available: true,
Yifan Hongffff9aa2017-06-01 14:34:29 -070016 export_include_dirs: ["include"],
17 shared_libs: [
18 "libutils",
19 "libbase",
Yifan Hong1d4368b2019-10-07 11:18:04 -070020
21 // Need latest HealthInfo definition from headers of this shared
22 // library. Clients don't need to link to this.
23 "android.hardware.health@2.1",
Yifan Hongffff9aa2017-06-01 14:34:29 -070024 ],
25 header_libs: ["libhealthd_headers"],
26 export_header_lib_headers: ["libhealthd_headers"],
27}
Yifan Hong2763df82017-09-19 17:57:50 -070028
Yifan Hong1cf853f2018-04-04 14:08:57 -070029cc_defaults {
30 name: "android.hardware.health@2.0-service_defaults",
Yifan Hong2763df82017-09-19 17:57:50 -070031
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080032 cflags: [
Chih-Hung Hsieh96352662017-11-29 14:24:50 -080033 "-Wall",
34 "-Werror",
35 ],
Yifan Hong2763df82017-09-19 17:57:50 -070036
37 static_libs: [
38 "android.hardware.health@2.0-impl",
39 "android.hardware.health@1.0-convert",
Yifan Hongaffa24f2018-01-19 15:53:25 -080040 "libhealthservice",
Hridya Valsaraju89178e72018-01-10 16:14:28 -080041 "libhealthstoragedefault",
Yifan Hong2763df82017-09-19 17:57:50 -070042 "libbatterymonitor",
43 ],
44
45 shared_libs: [
46 "libbase",
47 "libcutils",
48 "libhidlbase",
Yifan Hong2763df82017-09-19 17:57:50 -070049 "liblog",
50 "libutils",
51 "android.hardware.health@2.0",
52 ],
53}
Yifan Hong12df1b92017-09-25 17:25:00 -070054
55cc_binary {
Yifan Hong1cf853f2018-04-04 14:08:57 -070056 name: "android.hardware.health@2.0-service",
57 defaults: ["android.hardware.health@2.0-service_defaults"],
Yifan Hong31150c12018-05-01 14:59:43 -070058
Yifan Hongef26fe42018-07-10 13:07:08 -070059 vendor: true,
60 relative_install_path: "hw",
61 init_rc: ["android.hardware.health@2.0-service.rc"],
62 srcs: [
63 "HealthServiceDefault.cpp",
64 ],
Yifan Hong12df1b92017-09-25 17:25:00 -070065}
Tao Bao5747e222018-09-11 10:46:35 -070066
67cc_library_static {
68 name: "libhealthd_charger_nops",
Yifan Hong7dcf7b02019-10-08 17:27:11 -070069 recovery_available: true,
Tao Bao5747e222018-09-11 10:46:35 -070070
71 srcs: [
72 "healthd_mode_charger_nops.cpp",
73 ],
74
75 cflags: [
76 "-Wall",
77 "-Werror",
78 ],
79
80 header_libs: [
81 "libhealthd_headers",
82 ],
83
84 static_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -070085 "libhealthloop",
86 "libhealth2impl",
Tao Bao5747e222018-09-11 10:46:35 -070087 ],
88
89 shared_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -070090 "android.hardware.health@2.1",
Tao Bao5747e222018-09-11 10:46:35 -070091 "libutils",
92 ],
93}
Yifan Hong97eecdc2019-07-03 11:07:37 -070094
95sysprop_library {
96 name: "charger_sysprop",
Yifan Hong7dcf7b02019-10-08 17:27:11 -070097 recovery_available: true,
Yifan Hong97eecdc2019-07-03 11:07:37 -070098 srcs: ["charger.sysprop"],
99 property_owner: "Platform",
100 api_packages: ["android.sysprop"],
101}
Yifan Hongdbaa4772019-07-03 11:40:08 -0700102
103cc_library_static {
104 name: "libhealthd_draw",
105 export_include_dirs: ["."],
106 static_libs: [
107 "libcharger_sysprop",
108 "libminui",
109 ],
110 shared_libs: [
111 "libbase",
112 ],
113 header_libs: ["libbatteryservice_headers"],
114
115 srcs: ["healthd_draw.cpp"],
116}
117
118cc_library_static {
119 name: "libhealthd_charger",
120 local_include_dirs: ["include"],
121 export_include_dirs: [".", "include"],
122
123 static_libs: [
Yifan Hongdbaa4772019-07-03 11:40:08 -0700124 "android.hardware.health@1.0-convert",
125 "libcharger_sysprop",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700126 "libhealthd_draw",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700127 "libhealthloop",
128 "libhealth2impl",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700129 "libminui",
130 ],
131
132 shared_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700133 "android.hardware.health@2.1",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700134 "libbase",
135 "libcutils",
136 "liblog",
137 "libpng",
138 "libsuspend",
139 "libutils",
140 ],
141
142 srcs: [
143 "healthd_mode_charger.cpp",
144 "AnimationParser.cpp",
145 ],
146}
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700147
148cc_defaults {
149 name: "charger_defaults",
150
151 cflags: [
152 "-Wall",
153 "-Werror",
154 ],
155
156 shared_libs: [
157 // common
158 "android.hardware.health@2.0",
159 "android.hardware.health@2.1",
160 "libbase",
161 "libcutils",
162 "libhidlbase",
163 "liblog",
164 "libutils",
165
166 // system charger only
167 "libpng",
168 ],
169
170 static_libs: [
171 // common
172 "android.hardware.health@1.0-convert",
173 "libbatterymonitor",
174 "libcharger_sysprop",
175 "libhealthd_charger_nops",
176 "libhealthloop",
177 "libhealth2impl",
178
179 // system charger only
180 "libhealthd_draw",
181 "libhealthd_charger",
182 "libminui",
183 "libsuspend",
184 ],
185}
186
187cc_binary {
188 name: "charger",
189 defaults: ["charger_defaults"],
190 recovery_available: true,
191 srcs: [
192 "charger.cpp",
193 "charger_utils.cpp",
194 ],
195
196 target: {
197 recovery: {
198 // No UI and libsuspend for recovery charger.
199 cflags: [
200 "-DCHARGER_FORCE_NO_UI=1",
201 ],
202 exclude_shared_libs: [
203 "libpng",
204 ],
205 exclude_static_libs: [
206 "libhealthd_draw",
207 "libhealthd_charger",
208 "libminui",
209 "libsuspend",
210 ],
211 }
212 }
213}
214
215cc_test {
216 name: "charger_test",
217 defaults: ["charger_defaults"],
218 srcs: ["charger_test.cpp"],
219}
Yifan Hong12d15752020-08-05 16:25:33 -0700220
221cc_test {
222 name: "libhealthd_charger_test",
Yifan Hongc2bed972020-08-07 16:27:49 -0700223 defaults: ["charger_defaults"],
224 srcs: [
225 "AnimationParser_test.cpp",
226 "healthd_mode_charger_test.cpp"
Yifan Hong12d15752020-08-05 16:25:33 -0700227 ],
228 static_libs: [
Yifan Hongc2bed972020-08-07 16:27:49 -0700229 "libgmock",
Yifan Hong12d15752020-08-05 16:25:33 -0700230 ],
Yifan Hong186b4d92020-08-05 16:30:43 -0700231 test_suites: [
232 "general-tests",
233 "device-tests",
234 ],
Yifan Hongc2bed972020-08-07 16:27:49 -0700235 data: [
236 ":libhealthd_charger_test_data",
237 ],
238 require_root: true,
Yifan Hong12d15752020-08-05 16:25:33 -0700239}
Yifan Hong5109c8c2020-08-05 18:24:25 -0700240
241// /system/etc/res/images/charger/battery_fail.png
242prebuilt_etc {
243 name: "system_core_charger_res_images_battery_fail.png",
244 src: "images/battery_fail.png",
245 relative_install_path: "res/images/charger",
246 filename: "battery_fail.png",
247}
248
249// /system/etc/res/images/charger/battery_scale.png
250prebuilt_etc {
251 name: "system_core_charger_res_images_battery_scale.png",
252 src: "images/battery_scale.png",
253 relative_install_path: "res/images/charger",
254 filename: "battery_scale.png",
255}
256
257phony {
258 name: "charger_res_images",
259 required: [
260 "system_core_charger_res_images_battery_fail.png",
261 "system_core_charger_res_images_battery_scale.png",
262 ],
263}