blob: 05f2294ed489032ee2d754f55db8f537285d9ca2 [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",
Eric Jeong0fcaf8c2025-01-10 11:35:51 -0800166 team: "trendy_team_aaos_carframework_triage",
Tri Vo22b2d682017-07-11 12:53:12 -0700167 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700168 defaults: ["vhal_v2_0_target_defaults"],
Tri Vofc871402017-07-10 17:13:23 -0700169 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
Chih-Hung Hsiehad1bf312022-02-17 21:56:13 -0800170 tidy_timeout_srcs: [
171 "tests/VmsUtils_test.cpp",
172 ],
Tri Vofc871402017-07-10 17:13:23 -0700173 srcs: [
174 "tests/RecurrentTimer_test.cpp",
175 "tests/SubscriptionManager_test.cpp",
176 "tests/VehicleHalManager_test.cpp",
177 "tests/VehicleObjectPool_test.cpp",
178 "tests/VehiclePropConfigIndex_test.cpp",
Aditi Nagaraj8dcab8e2018-01-10 17:10:01 -0800179 "tests/VmsUtils_test.cpp",
Tri Vofc871402017-07-10 17:13:23 -0700180 ],
Felipe Leme75a27f82020-01-31 15:25:55 -0800181 shared_libs: [
182 "libbase",
Yu Shan8ae3ea92021-06-01 15:44:43 -0700183 "libcutils",
Felipe Leme75a27f82020-01-31 15:25:55 -0800184 ],
Yu Shan39844572021-06-23 20:42:24 -0700185 // Exclude share libraries from default because they might be missing on
186 // some test platforms and we are using static libraries instead.
Yu Shan045138d2021-06-02 16:15:29 -0700187 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900188 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700189 "android.hardware.automotive.vehicle@2.0",
190 ],
191 static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900192 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700193 "android.hardware.automotive.vehicle@2.0",
194 ],
Tri Vofc871402017-07-10 17:13:23 -0700195 header_libs: ["libbase_headers"],
Keun Soo YIMff84c372018-11-27 14:04:42 -0800196 test_suites: ["general-tests"],
Tri Vofc871402017-07-10 17:13:23 -0700197}
198
Hao Chen1c1fdca2019-11-15 14:20:34 -0800199cc_test {
200 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests",
Eric Jeong0fcaf8c2025-01-10 11:35:51 -0800201 team: "trendy_team_aaos_carframework_triage",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800202 vendor: true,
Hao Chenc324db92020-06-03 18:29:31 -0700203 defaults: ["vhal_v2_0_target_defaults"],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800204 srcs: [
205 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
Yu Shan39844572021-06-23 20:42:24 -0700206 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800207 ],
208 static_libs: [
Yu Shan39844572021-06-23 20:42:24 -0700209 "libbase",
210 "libcutils",
Yu Shan795f4de2021-07-01 15:41:19 -0700211 "libgmock",
Yu Shan39844572021-06-23 20:42:24 -0700212 "libjsoncpp",
213 "libprotobuf-cpp-lite",
214 ],
215 // Exclude share libraries from default because they might be missing on
216 // some test platforms and we are using static libraries instead.
217 exclude_shared_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900218 "android.automotive.watchdog-V2-ndk",
Yu Shan39844572021-06-23 20:42:24 -0700219 "android.hardware.automotive.vehicle@2.0",
220 ],
221 whole_static_libs: [
Jiyong Parkc426c6d2021-08-04 12:48:07 +0900222 "android.automotive.watchdog-V2-ndk",
Yu Shan045138d2021-06-02 16:15:29 -0700223 "android.hardware.automotive.vehicle@2.0",
Hao Chen1c1fdca2019-11-15 14:20:34 -0800224 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
225 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan045138d2021-06-02 16:15:29 -0700226 ],
Yu Shan4a239012021-07-20 18:12:53 -0700227 data: [
Yu Shan4a239012021-07-20 18:12:53 -0700228 ":vhal_test_json",
Yu Shan56020bc2021-07-16 15:51:16 -0700229 ":vhal_test_override_json",
Yu Shan4a239012021-07-20 18:12:53 -0700230 ],
Hao Chen1c1fdca2019-11-15 14:20:34 -0800231 test_suites: ["general-tests"],
232}
233
Yu Shan2842eb52022-08-31 18:08:10 -0700234cc_test {
235 name: "android.hardware.automotive.vehicle@2.0-default-config-test",
Eric Jeong0fcaf8c2025-01-10 11:35:51 -0800236 team: "trendy_team_aaos_carframework_triage",
Yu Shan2842eb52022-08-31 18:08:10 -0700237 vendor: true,
238 defaults: ["vhal_v2_0_target_defaults"],
239 srcs: [
240 "impl/vhal_v2_0/tests/DefaultConfigSupportedPropertyIds_test.cpp",
241 ],
242 cflags: [
243 "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
244 "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
245 ],
246 static_libs: [
247 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
248 "libgtest",
249 "libgmock",
250 ],
251 test_suites: ["general-tests"],
252}
253
Tri Vofc871402017-07-10 17:13:23 -0700254cc_binary {
Yu Shan612dbf62021-07-02 18:11:08 -0700255 name: "android.hardware.automotive.vehicle@2.0-default-service",
Hao Chenc324db92020-06-03 18:29:31 -0700256 defaults: ["vhal_v2_0_target_defaults"],
Calvin Huanga6536162020-04-20 12:41:20 -0700257 vintf_fragments: [
Yu Shan612dbf62021-07-02 18:11:08 -0700258 "android.hardware.automotive.vehicle@2.0-default-service.xml",
Calvin Huanga6536162020-04-20 12:41:20 -0700259 ],
Yu Shan612dbf62021-07-02 18:11:08 -0700260 init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"],
Tri Vo22b2d682017-07-11 12:53:12 -0700261 vendor: true,
Tri Vofc871402017-07-10 17:13:23 -0700262 relative_install_path: "hw",
263 srcs: ["VehicleService.cpp"],
264 shared_libs: [
265 "libbase",
Inseob Kim31ab19f2019-09-10 14:56:19 +0900266 "libjsoncpp",
Tri Vofc871402017-07-10 17:13:23 -0700267 "libprotobuf-cpp-lite",
268 ],
269 static_libs: [
270 "android.hardware.automotive.vehicle@2.0-manager-lib",
Tri Vofc871402017-07-10 17:13:23 -0700271 "android.hardware.automotive.vehicle@2.0-libproto-native",
Yu Shan612dbf62021-07-02 18:11:08 -0700272 "android.hardware.automotive.vehicle@2.0-default-impl-lib",
Tri Vofc871402017-07-10 17:13:23 -0700273 ],
274}
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530275
276cc_fuzz {
277 name: "vehicleManager_fuzzer",
278 vendor: true,
279 defaults: ["vhal_v2_0_target_defaults"],
280 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"],
281 srcs: [
282 "tests/fuzzer/VehicleManager_fuzzer.cpp",
283 ],
284 shared_libs: [
285 "libbase",
286 "libcutils",
287 "libbinder_ndk",
288 ],
289 header_libs: ["libbase_headers"],
290 local_include_dirs: [
291 "common/include",
292 "tests",
293 ],
294 fuzz_config: {
295 cc: [
Akshata Kadamb333fa52024-04-08 15:04:20 +0530296 "ericjeong@google.com",
297 "shanyu@google.com",
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530298 ],
299 componentid: 533764,
Ayushi Khopkar5088c6c2023-03-17 18:19:58 +0530300 hotlists: [
301 "4593311",
302 ],
303 description: "The fuzzer targets the APIs of android.hardware.automotive.vehicle@2.0-manager-lib",
304 vector: "local_no_privileges_required",
305 service_privilege: "privileged",
306 users: "multi_user",
307 fuzzed_code_usage: "shipped",
Ayushi Khopkarb3057b02020-08-31 10:59:52 +0530308 },
309}