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 "android.hardware.automotive.vehicle@2.0", 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: "android.hardware.automotive.vehicle@2.0-manager-lib", 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 "android.hardware.automotive.vehicle@2.0-libproto-native", 80 ], 81} 82 83// Vehicle default VehicleHAL implementation 84cc_library_static { 85 name: "android.hardware.automotive.vehicle@2.0-default-impl-lib", 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 "android.hardware.automotive.vehicle@2.0-fake-user-hal-lib", 105 "android.hardware.automotive.vehicle@2.0-manager-lib", 106 ], 107 shared_libs: [ 108 "libbase", 109 "libjsoncpp", 110 "libprotobuf-cpp-lite", 111 ], 112 static_libs: [ 113 "android.hardware.automotive.vehicle@2.0-libproto-native", 114 ], 115} 116 117// 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", 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 "android.hardware.automotive.vehicle@2.0-libproto-native", 134 ], 135} 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: [ 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 "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 164cc_test { 165 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests", 166 team: "trendy_team_aaos_carframework_triage", 167 vendor: true, 168 defaults: ["vhal_v2_0_target_defaults"], 169 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], 170 tidy_timeout_srcs: [ 171 "tests/VmsUtils_test.cpp", 172 ], 173 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", 179 "tests/VmsUtils_test.cpp", 180 ], 181 shared_libs: [ 182 "libbase", 183 "libcutils", 184 ], 185 // Exclude share libraries from default because they might be missing on 186 // some test platforms and we are using static libraries instead. 187 exclude_shared_libs: [ 188 "android.automotive.watchdog-V2-ndk", 189 "android.hardware.automotive.vehicle@2.0", 190 ], 191 static_libs: [ 192 "android.automotive.watchdog-V2-ndk", 193 "android.hardware.automotive.vehicle@2.0", 194 ], 195 header_libs: ["libbase_headers"], 196 test_suites: ["general-tests"], 197} 198 199cc_test { 200 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests", 201 team: "trendy_team_aaos_carframework_triage", 202 vendor: true, 203 defaults: ["vhal_v2_0_target_defaults"], 204 srcs: [ 205 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", 206 "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp", 207 ], 208 static_libs: [ 209 "libbase", 210 "libcutils", 211 "libgmock", 212 "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: [ 218 "android.automotive.watchdog-V2-ndk", 219 "android.hardware.automotive.vehicle@2.0", 220 ], 221 whole_static_libs: [ 222 "android.automotive.watchdog-V2-ndk", 223 "android.hardware.automotive.vehicle@2.0", 224 "android.hardware.automotive.vehicle@2.0-default-impl-lib", 225 "android.hardware.automotive.vehicle@2.0-libproto-native", 226 ], 227 data: [ 228 ":vhal_test_json", 229 ":vhal_test_override_json", 230 ], 231 test_suites: ["general-tests"], 232} 233 234cc_test { 235 name: "android.hardware.automotive.vehicle@2.0-default-config-test", 236 team: "trendy_team_aaos_carframework_triage", 237 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 254cc_binary { 255 name: "android.hardware.automotive.vehicle@2.0-default-service", 256 defaults: ["vhal_v2_0_target_defaults"], 257 vintf_fragments: [ 258 "android.hardware.automotive.vehicle@2.0-default-service.xml", 259 ], 260 init_rc: ["android.hardware.automotive.vehicle@2.0-default-service.rc"], 261 vendor: true, 262 relative_install_path: "hw", 263 srcs: ["VehicleService.cpp"], 264 shared_libs: [ 265 "libbase", 266 "libjsoncpp", 267 "libprotobuf-cpp-lite", 268 ], 269 static_libs: [ 270 "android.hardware.automotive.vehicle@2.0-manager-lib", 271 "android.hardware.automotive.vehicle@2.0-libproto-native", 272 "android.hardware.automotive.vehicle@2.0-default-impl-lib", 273 ], 274} 275 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: [ 296 "ericjeong@google.com", 297 "shanyu@google.com", 298 ], 299 componentid: 533764, 300 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", 308 }, 309} 310