xref: /aosp_15_r20/hardware/interfaces/automotive/vehicle/2.0/default/Android.bp (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1// 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
15package {
16    default_team: "trendy_team_aaos_framework",
17    // 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
25cc_defaults {
26    name: "vhal_v2_0_defaults",
27    shared_libs: [
28        "libhidlbase",
29        "liblog",
30        "libutils",
31        "[email protected]",
32    ],
33    cflags: [
34        "-Wall",
35        "-Wextra",
36        "-Werror",
37    ],
38}
39
40cc_defaults {
41    name: "vhal_v2_0_target_defaults",
42    defaults: ["vhal_v2_0_defaults"],
43    shared_libs: [
44        "libbinder_ndk",
45        "android.automotive.watchdog-V2-ndk",
46    ],
47}
48
49cc_library_headers {
50    name: "vhal_v2_0_common_headers",
51    visibility: ["//visibility:public"],
52    vendor: true,
53    export_include_dirs: ["common/include/vhal_v2_0"],
54}
55
56// Vehicle reference implementation lib
57cc_library {
58    name: "[email protected]",
59    vendor: true,
60    defaults: ["vhal_v2_0_target_defaults"],
61    srcs: [
62        "common/src/Obd2SensorStore.cpp",
63        "common/src/ProtoMessageConverter.cpp",
64        "common/src/SubscriptionManager.cpp",
65        "common/src/VehicleHalManager.cpp",
66        "common/src/VehicleObjectPool.cpp",
67        "common/src/VehiclePropertyStore.cpp",
68        "common/src/VehicleUtils.cpp",
69        "common/src/VmsUtils.cpp",
70        "common/src/WatchdogClient.cpp",
71    ],
72    shared_libs: [
73        "libbase",
74        "libprotobuf-cpp-lite",
75    ],
76    local_include_dirs: ["common/include/vhal_v2_0"],
77    export_include_dirs: ["common/include"],
78    static_libs: [
79        "[email protected]",
80    ],
81}
82
83// Vehicle default VehicleHAL implementation
84cc_library_static {
85    name: "[email protected]",
86    vendor: true,
87    defaults: ["vhal_v2_0_target_defaults"],
88    cflags: [
89        "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
90        "-DENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS",
91    ],
92    srcs: [
93        "impl/vhal_v2_0/DefaultVehicleHal.cpp",
94        "impl/vhal_v2_0/VehicleHalClient.cpp",
95        "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
96        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
97        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
98        "impl/vhal_v2_0/GeneratorHub.cpp",
99        "impl/vhal_v2_0/FakeObd2Frame.cpp",
100    ],
101    local_include_dirs: ["common/include/vhal_v2_0"],
102    export_include_dirs: ["impl"],
103    whole_static_libs: [
104        "[email protected]",
105        "[email protected]",
106    ],
107    shared_libs: [
108        "libbase",
109        "libjsoncpp",
110        "libprotobuf-cpp-lite",
111    ],
112    static_libs: [
113        "[email protected]",
114    ],
115}
116
117// Vehicle HAL Server reference impl lib
118cc_library_static {
119    name: "[email protected]",
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",
127        "common/src/ProtoMessageConverter.cpp",
128        "common/src/VehicleObjectPool.cpp",
129        "common/src/VehiclePropertyStore.cpp",
130        "common/src/VehicleUtils.cpp",
131    ],
132    static_libs: [
133        "[email protected]",
134    ],
135}
136
137// Vehicle HAL Server default implementation
138cc_library_static {
139    name: "[email protected]",
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: [
146        "impl/vhal_v2_0/GeneratorHub.cpp",
147        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
148        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
149        "impl/vhal_v2_0/DefaultVehicleHalServer.cpp",
150        "impl/vhal_v2_0/FakeObd2Frame.cpp",
151    ],
152    whole_static_libs: [
153        "[email protected]",
154    ],
155    static_libs: [
156        "[email protected]",
157    ],
158    shared_libs: [
159        "libbase",
160        "libjsoncpp",
161    ],
162}
163
164cc_test {
165    name: "[email protected]",
166    vendor: true,
167    defaults: ["vhal_v2_0_target_defaults"],
168    whole_static_libs: ["[email protected]"],
169    tidy_timeout_srcs: [
170        "tests/VmsUtils_test.cpp",
171    ],
172    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",
178        "tests/VmsUtils_test.cpp",
179    ],
180    shared_libs: [
181        "libbase",
182        "libcutils",
183    ],
184    // Exclude share libraries from default because they might be missing on
185    // some test platforms and we are using static libraries instead.
186    exclude_shared_libs: [
187        "android.automotive.watchdog-V2-ndk",
188        "[email protected]",
189    ],
190    static_libs: [
191        "android.automotive.watchdog-V2-ndk",
192        "[email protected]",
193    ],
194    header_libs: ["libbase_headers"],
195    test_suites: ["general-tests"],
196}
197
198cc_test {
199    name: "[email protected]",
200    vendor: true,
201    defaults: ["vhal_v2_0_target_defaults"],
202    srcs: [
203        "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp",
204        "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp",
205    ],
206    static_libs: [
207        "libbase",
208        "libcutils",
209        "libgmock",
210        "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: [
216        "android.automotive.watchdog-V2-ndk",
217        "[email protected]",
218    ],
219    whole_static_libs: [
220        "android.automotive.watchdog-V2-ndk",
221        "[email protected]",
222        "[email protected]",
223        "[email protected]",
224    ],
225    data: [
226        ":vhal_test_json",
227        ":vhal_test_override_json",
228    ],
229    test_suites: ["general-tests"],
230}
231
232cc_test {
233    name: "[email protected]",
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        "[email protected]",
245        "libgtest",
246        "libgmock",
247    ],
248    test_suites: ["general-tests"],
249}
250
251cc_binary {
252    name: "[email protected]",
253    defaults: ["vhal_v2_0_target_defaults"],
254    vintf_fragments: [
255        "[email protected]",
256    ],
257    init_rc: ["[email protected]"],
258    vendor: true,
259    relative_install_path: "hw",
260    srcs: ["VehicleService.cpp"],
261    shared_libs: [
262        "libbase",
263        "libjsoncpp",
264        "libprotobuf-cpp-lite",
265    ],
266    static_libs: [
267        "[email protected]",
268        "[email protected]",
269        "[email protected]",
270    ],
271}
272
273cc_fuzz {
274    name: "vehicleManager_fuzzer",
275    vendor: true,
276    defaults: ["vhal_v2_0_target_defaults"],
277    whole_static_libs: ["[email protected]"],
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            "[email protected]",
294            "[email protected]",
295        ],
296        componentid: 533764,
297        hotlists: [
298            "4593311",
299        ],
300        description: "The fuzzer targets the APIs of [email protected]",
301        vector: "local_no_privileges_required",
302        service_privilege: "privileged",
303        users: "multi_user",
304        fuzzed_code_usage: "shipped",
305    },
306}
307