blob: 65eaedd90a45921ee9ff8451a0a6f43b7b4f8dd0 [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 ],
65
Yifan Hong31150c12018-05-01 14:59:43 -070066 overrides: [
67 "healthd",
68 ]
Yifan Hong1cf853f2018-04-04 14:08:57 -070069}
70
71cc_binary {
Yifan Hong12df1b92017-09-25 17:25:00 -070072 name: "healthd",
Yifan Hongef26fe42018-07-10 13:07:08 -070073 defaults: ["android.hardware.health@2.0-service_defaults"],
74
Yifan Hongfd1aa702018-04-04 14:08:04 -070075 init_rc: ["healthd.rc"],
Yifan Hongcded9002017-11-06 16:47:54 -080076 srcs: [
Yifan Hongcded9002017-11-06 16:47:54 -080077 "HealthServiceHealthd.cpp",
78 ],
Yifan Hong12df1b92017-09-25 17:25:00 -070079 local_include_dirs: ["include"],
80
Yifan Hong12df1b92017-09-25 17:25:00 -070081 shared_libs: [
Yifan Hong31cc64a2017-11-06 16:48:36 -080082 "android.hardware.health@1.0",
Yifan Hong12df1b92017-09-25 17:25:00 -070083 ],
84
Yifan Hong3a39eec2018-04-27 15:03:32 -070085 vintf_fragments: [
86 "manifest_healthd.xml"
87 ],
Yifan Hong12df1b92017-09-25 17:25:00 -070088}
Tao Bao5747e222018-09-11 10:46:35 -070089
90cc_library_static {
91 name: "libhealthd_charger_nops",
Yifan Hong7dcf7b02019-10-08 17:27:11 -070092 recovery_available: true,
Tao Bao5747e222018-09-11 10:46:35 -070093
94 srcs: [
95 "healthd_mode_charger_nops.cpp",
96 ],
97
98 cflags: [
99 "-Wall",
100 "-Werror",
101 ],
102
103 header_libs: [
104 "libhealthd_headers",
105 ],
106
107 static_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700108 "libhealthloop",
109 "libhealth2impl",
Tao Bao5747e222018-09-11 10:46:35 -0700110 ],
111
112 shared_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700113 "android.hardware.health@2.1",
Tao Bao5747e222018-09-11 10:46:35 -0700114 "libutils",
115 ],
116}
Yifan Hong97eecdc2019-07-03 11:07:37 -0700117
118sysprop_library {
119 name: "charger_sysprop",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700120 recovery_available: true,
Yifan Hong97eecdc2019-07-03 11:07:37 -0700121 srcs: ["charger.sysprop"],
122 property_owner: "Platform",
123 api_packages: ["android.sysprop"],
124}
Yifan Hongdbaa4772019-07-03 11:40:08 -0700125
126cc_library_static {
127 name: "libhealthd_draw",
128 export_include_dirs: ["."],
129 static_libs: [
130 "libcharger_sysprop",
131 "libminui",
132 ],
133 shared_libs: [
134 "libbase",
135 ],
136 header_libs: ["libbatteryservice_headers"],
137
138 srcs: ["healthd_draw.cpp"],
139}
140
141cc_library_static {
142 name: "libhealthd_charger",
143 local_include_dirs: ["include"],
144 export_include_dirs: [".", "include"],
145
146 static_libs: [
Yifan Hongdbaa4772019-07-03 11:40:08 -0700147 "android.hardware.health@1.0-convert",
148 "libcharger_sysprop",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700149 "libhealthd_draw",
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700150 "libhealthloop",
151 "libhealth2impl",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700152 "libminui",
153 ],
154
155 shared_libs: [
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700156 "android.hardware.health@2.1",
Yifan Hongdbaa4772019-07-03 11:40:08 -0700157 "libbase",
158 "libcutils",
159 "liblog",
160 "libpng",
161 "libsuspend",
162 "libutils",
163 ],
164
165 srcs: [
166 "healthd_mode_charger.cpp",
167 "AnimationParser.cpp",
168 ],
169}
Yifan Hong7dcf7b02019-10-08 17:27:11 -0700170
171cc_defaults {
172 name: "charger_defaults",
173
174 cflags: [
175 "-Wall",
176 "-Werror",
177 ],
178
179 shared_libs: [
180 // common
181 "android.hardware.health@2.0",
182 "android.hardware.health@2.1",
183 "libbase",
184 "libcutils",
185 "libhidlbase",
186 "liblog",
187 "libutils",
188
189 // system charger only
190 "libpng",
191 ],
192
193 static_libs: [
194 // common
195 "android.hardware.health@1.0-convert",
196 "libbatterymonitor",
197 "libcharger_sysprop",
198 "libhealthd_charger_nops",
199 "libhealthloop",
200 "libhealth2impl",
201
202 // system charger only
203 "libhealthd_draw",
204 "libhealthd_charger",
205 "libminui",
206 "libsuspend",
207 ],
208}
209
210cc_binary {
211 name: "charger",
212 defaults: ["charger_defaults"],
213 recovery_available: true,
214 srcs: [
215 "charger.cpp",
216 "charger_utils.cpp",
217 ],
218
219 target: {
220 recovery: {
221 // No UI and libsuspend for recovery charger.
222 cflags: [
223 "-DCHARGER_FORCE_NO_UI=1",
224 ],
225 exclude_shared_libs: [
226 "libpng",
227 ],
228 exclude_static_libs: [
229 "libhealthd_draw",
230 "libhealthd_charger",
231 "libminui",
232 "libsuspend",
233 ],
234 }
235 }
236}
237
238cc_test {
239 name: "charger_test",
240 defaults: ["charger_defaults"],
241 srcs: ["charger_test.cpp"],
242}
Yifan Hong12d15752020-08-05 16:25:33 -0700243
244cc_test {
245 name: "libhealthd_charger_test",
246 srcs: ["AnimationParser_test.cpp"],
247 shared_libs: [
248 "liblog",
249 "libbase",
250 "libcutils",
251 ],
252 static_libs: [
253 "libhealthd_charger",
254 ],
Yifan Hong186b4d92020-08-05 16:30:43 -0700255 test_suites: [
256 "general-tests",
257 "device-tests",
258 ],
Yifan Hong12d15752020-08-05 16:25:33 -0700259}