blob: 94a58821ed1613f4071244a123399191bd324128 [file] [log] [blame]
Tri Vofc871402017-07-10 17:13:23 -07001// Copyright (C) 2017 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badourc22b35b2021-02-23 14:26:20 -080015package {
Aditya Choudhary04ef2122024-02-02 14:00:43 +000016 default_team: "trendy_team_aaos_framework",
Bob Badourc22b35b2021-02-23 14:26:20 -080017 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "hardware_interfaces_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["hardware_interfaces_license"],
23}
24
Tri Vofc871402017-07-10 17:13:23 -070025cc_defaults {
26 name: "vhal_v2_0_defaults",
27 shared_libs: [
28 "libhidlbase",
Tri Vofc871402017-07-10 17:13:23 -070029 "liblog",
30 "libutils",
31 "android.hardware.automotive.vehicle@2.0",
32 ],
33 cflags: [
34 "-Wall",
35 "-Wextra",
36 "-Werror",
37 ],
38}
39
Hao Chenc324db92020-06-03 18:29:31 -070040cc_defaults {
41 name: "vhal_v2_0_target_defaults",
42 defaults: ["vhal_v2_0_defaults"],
43 shared_libs: [
44 "libbinder_ndk",
Jiyong Parkc426c6d2021-08-04 12:48:07 +090045 "android.automotive.watchdog-V2-ndk",
Hao Chenc324db92020-06-03 18:29:31 -070046 ],
47}
48
Tri Vofc871402017-07-10 17:13:23 -070049cc_library_headers {
50 name: "vhal_v2_0_common_headers",
Yu Shan6029a372021-06-22 19:11:05 -070051 visibility: ["//visibility:public"],
Tri Vo22b2d682017-07-11 12:53:12 -070052 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -070053 export_include_dirs: ["common/include/vhal_v2_0"],
54}
55
56// Vehicle reference implementation lib
Anthony Maha9d8c0d2017-10-03 16:22:22 -070057cc_library {
Tri Vofc871402017-07-10 17:13:23 -070058 name: "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vo22b2d682017-07-11 12:53:12 -070059 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -070060 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -070061 srcs: [
Pavel Maltsev250139c2017-08-24 15:09:41 -070062 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -070063 "common/src/ProtoMessageConverter.cpp",
Tri Vofc871402017-07-10 17:13:23 -070064 "common/src/SubscriptionManager.cpp",
65 "common/src/VehicleHalManager.cpp",
66 "common/src/VehicleObjectPool.cpp",
67 "common/src/VehiclePropertyStore.cpp",
68 "common/src/VehicleUtils.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -080069 "common/src/VmsUtils.cpp",
Eric Jeong908101a2020-04-23 09:43:55 -070070 "common/src/WatchdogClient.cpp",
Tri Vofc871402017-07-10 17:13:23 -070071 ],
Felipe Leme75a27f82020-01-31 15:25:55 -080072 shared_libs: [
73 "libbase",
Yu Shan6029a372021-06-22 19:11:05 -070074 "libprotobuf-cpp-lite",
Felipe Leme75a27f82020-01-31 15:25:55 -080075 ],
Tri Vofc871402017-07-10 17:13:23 -070076 local_include_dirs: ["common/include/vhal_v2_0"],
77 export_include_dirs: ["common/include"],
Yu Shan6029a372021-06-22 19:11:05 -070078 static_libs: [
79 "android.hardware.automotive.vehicle@2.0-libproto-native",
80 ],
Tri Vofc871402017-07-10 17:13:23 -070081}
82
Tri Vofc871402017-07-10 17:13:23 -070083// Vehicle default VehicleHAL implementation
84cc_library_static {
85 name: "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vo22b2d682017-07-11 12:53:12 -070086 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -070087 defaults: ["vhal_v2_0_target_defaults"],
Yu Shan2842eb52022-08-31 18:08:10 -070088 cflags: [
89 "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
90 "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
91 ],
Tri Vofc871402017-07-10 17:13:23 -070092 srcs: [
Yu Shan6029a372021-06-22 19:11:05 -070093 "impl/vhal_v2_0/DefaultVehicleHal.cpp",
Hao Chena6d6fa32020-02-14 11:51:26 -080094 "impl/vhal_v2_0/VehicleHalClient.cpp",
Yu Shan6029a372021-06-22 19:11:05 -070095 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Chao Yanf63c2ca2018-04-17 11:32:39 -070096 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
97 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
Chao Yan0f85dd12018-06-04 14:03:02 -070098 "impl/vhal_v2_0/GeneratorHub.cpp",
Yu Shan122eea62021-07-20 18:22:23 -070099 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700100 ],
101 local_include_dirs: ["common/include/vhal_v2_0"],
102 export_include_dirs: ["impl"],
felipeal9c998c02020-04-17 14:32:53 -0700103 whole_static_libs: [
Yu Shan58f71e72021-08-03 16:49:40 -0700104 "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib",
felipeal9c998c02020-04-17 14:32:53 -0700105 "android.hardware.automotive.vehicle@2.0-manager-lib",
106 ],
Tri Vofc871402017-07-10 17:13:23 -0700107 shared_libs: [
108 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900109 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700110 "libprotobuf-cpp-lite",
111 ],
112 static_libs: [
Tri Vofc871402017-07-10 17:13:23 -0700113 "android.hardware.automotive.vehicle@2.0-libproto-native",
114 ],
115}
116
Hao Chenc324db92020-06-03 18:29:31 -0700117// Vehicle HAL Server reference impl lib
118cc_library_static {
119 name: "android.hardware.automotive.vehicle@2.0-server-common-lib",
120 vendor: true,
121 host_supported: true,
122 defaults: ["vhal_v2_0_defaults"],
123 local_include_dirs: ["common/include/vhal_v2_0"],
124 export_include_dirs: ["common/include"],
125 srcs: [
126 "common/src/Obd2SensorStore.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700127 "common/src/ProtoMessageConverter.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700128 "common/src/VehicleObjectPool.cpp",
Hao Chen0b7c2872021-05-12 12:21:33 -0700129 "common/src/VehiclePropertyStore.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700130 "common/src/VehicleUtils.cpp",
131 ],
Yu Shan6029a372021-06-22 19:11:05 -0700132 static_libs: [
133 "android.hardware.automotive.vehicle@2.0-libproto-native",
134 ],
Hao Chenc324db92020-06-03 18:29:31 -0700135}
136
137// Vehicle HAL Server default implementation
138cc_library_static {
139 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib",
140 vendor: true,
141 host_supported: true,
142 defaults: ["vhal_v2_0_defaults"],
143 local_include_dirs: ["common/include/vhal_v2_0"],
144 export_include_dirs: ["impl"],
145 srcs: [
Hao Chenc324db92020-06-03 18:29:31 -0700146 "impl/vhal_v2_0/GeneratorHub.cpp",
147 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
148 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
Yu Shan6029a372021-06-22 19:11:05 -0700149 "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
Yu Shan122eea62021-07-20 18:22:23 -0700150 "impl/vhal_v2_0/FakeObd2Frame.cpp",
Hao Chenc324db92020-06-03 18:29:31 -0700151 ],
152 whole_static_libs: [
153 "android.hardware.automotive.vehicle@2.0-server-common-lib",
154 ],
155 static_libs: [
156 "android.hardware.automotive.vehicle@2.0-libproto-native",
157 ],
158 shared_libs: [
159 "libbase",
160 "libjsoncpp",
161 ],
162}
163
Tri Vofc871402017-07-10 17:13:23 -0700164cc_test {
165 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
Tri Vo22b2d682017-07-11 12:53:12 -0700166 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700167 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700168 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
Chih-Hung Hsiehad1bf312022-02-17 21:56:13 -0800169 tidy_timeout_srcs: [
170 "tests/VmsUtils_test.cpp",
171 ],
Tri Vofc871402017-07-10 17:13:23 -0700172 srcs: [
173 "tests/RecurrentTimer_test.cpp",
174 "tests/SubscriptionManager_test.cpp",
175 "tests/VehicleHalManager_test.cpp",
176 "tests/VehicleObjectPool_test.cpp",
177 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800178 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700179 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800180 shared_libs: [
181 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700182 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800183 ],
Yu Shan39844572021-06-23 20:42:24 -0700184 // Exclude share libraries from default because they might be missing on
185 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700186 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900187 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700188 "android.hardware.automotive.vehicle@2.0",
189 ],
190 static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900191 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700192 "android.hardware.automotive.vehicle@2.0",
193 ],
Tri Vofc871402017-07-10 17:13:23 -0700194 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800195 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700196}
197
Hao Chen1c1fdca2019-11-15 14:20:34 -0800198cc_test {
199 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
200 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700201 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800202 srcs: [
203 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700204 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800205 ],
206 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700207 "libbase",
208 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700209 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700210 "libjsoncpp",
211 "libprotobuf-cpp-lite",
212 ],
213 // Exclude share libraries from default because they might be missing on
214 // some test platforms and we are using static libraries instead.
215 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900216 "android.automotive.watchdog-V2-ndk",
Yu Shan39844572021-06-23 20:42:24 -0700217 "android.hardware.automotive.vehicle@2.0",
218 ],
219 whole_static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900220 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700221 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800222 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
223 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700224 ],
Yu Shan4a239012021-07-20 18:12:53 -0700225 data: [
Yu Shan4a239012021-07-20 18:12:53 -0700226 ":vhal_test_json",
Yu Shan56020bc2021-07-16 15:51:16 -0700227 ":vhal_test_override_json",
Yu Shan4a239012021-07-20 18:12:53 -0700228 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800229 test_suites: ["general-tests"],
230}
231
Yu Shan2842eb52022-08-31 18:08:10 -0700232cc_test {
233 name: "android.hardware.automotive.vehicle@2.0-default-config-test",
234 vendor: true,
235 defaults: ["vhal_v2_0_target_defaults"],
236 srcs: [
237 "impl/vhal_v2_0/tests/DefaultConfigSupportedPropertyIds_test.cpp",
238 ],
239 cflags: [
240 "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
241 "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
242 ],
243 static_libs: [
244 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
245 "libgtest",
246 "libgmock",
247 ],
248 test_suites: ["general-tests"],
249}
250
Tri Vofc871402017-07-10 17:13:23 -0700251cc_binary {
Yu Shan612dbf62021-07-02 18:11:08 -0700252 name: "android.hardware.automotive.vehicle@2.0-default-service",
Hao Chenc324db92020-06-03 18:29:31 -0700253 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700254 vintf_fragments: [
Yu Shan612dbf62021-07-02 18:11:08 -0700255 "android.hardware.automotive.vehicle@2.0-default-service.xml",
Calvin Huanga6536162020-04-20 12:41:20 -0700256 ],
Yu Shan612dbf62021-07-02 18:11:08 -0700257 init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700258 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700259 relative_install_path: "hw",
260 srcs: ["VehicleService.cpp"],
261 shared_libs: [
262 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900263 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700264 "libprotobuf-cpp-lite",
265 ],
266 static_libs: [
267 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700268 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan612dbf62021-07-02 18:11:08 -0700269 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700270 ],
271}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530272
273cc_fuzz {
274 name: "vehicleManager_fuzzer",
275 vendor: true,
276 defaults: ["vhal_v2_0_target_defaults"],
277 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
278 srcs: [
279 "tests/fuzzer/VehicleManager_fuzzer.cpp",
280 ],
281 shared_libs: [
282 "libbase",
283 "libcutils",
284 "libbinder_ndk",
285 ],
286 header_libs: ["libbase_headers"],
287 local_include_dirs: [
288 "common/include",
289 "tests",
290 ],
291 fuzz_config: {
292 cc: [
293 "android-media-fuzzing-reports@google.com",
294 ],
295 componentid: 533764,
Ayushi Khopkar5088c6c2023-03-17 18:19:58 +0530296 hotlists: [
297 "4593311",
298 ],
299 description: "The fuzzer targets the APIs of android.hardware.automotive.vehicle@2.0-manager-lib",
300 vector: "local_no_privileges_required",
301 service_privilege: "privileged",
302 users: "multi_user",
303 fuzzed_code_usage: "shipped",
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530304 },
305}