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 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "hardware_interfaces_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["hardware_interfaces_license"], 22} 23 24cc_defaults { 25 name: "vhal_v2_0_defaults", 26 shared_libs: [ 27 "libhidlbase", 28 "liblog", 29 "libutils", 30 "android.hardware.automotive.vehicle@2.0", 31 ], 32 cflags: [ 33 "-Wall", 34 "-Wextra", 35 "-Werror", 36 ], 37} 38 39cc_defaults { 40 name: "vhal_v2_0_target_defaults", 41 defaults: ["vhal_v2_0_defaults"], 42 shared_libs: [ 43 "libbinder_ndk", 44 "android.automotive.watchdog-V2-ndk_platform", 45 ], 46} 47 48cc_library_headers { 49 name: "vhal_v2_0_common_headers", 50 vendor: true, 51 export_include_dirs: ["common/include/vhal_v2_0"], 52} 53 54// Vehicle reference implementation lib 55cc_library { 56 name: "android.hardware.automotive.vehicle@2.0-manager-lib", 57 vendor: true, 58 defaults: ["vhal_v2_0_target_defaults"], 59 srcs: [ 60 "common/src/Obd2SensorStore.cpp", 61 "common/src/SubscriptionManager.cpp", 62 "common/src/VehicleHalManager.cpp", 63 "common/src/VehicleObjectPool.cpp", 64 "common/src/VehiclePropertyStore.cpp", 65 "common/src/VehicleUtils.cpp", 66 "common/src/VmsUtils.cpp", 67 "common/src/WatchdogClient.cpp", 68 ], 69 shared_libs: [ 70 "libbase", 71 ], 72 local_include_dirs: ["common/include/vhal_v2_0"], 73 export_include_dirs: ["common/include"], 74} 75 76// Vehicle default VehicleHAL implementation 77cc_library_static { 78 name: "android.hardware.automotive.vehicle@2.0-default-impl-lib", 79 vendor: true, 80 defaults: ["vhal_v2_0_target_defaults"], 81 cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], 82 srcs: [ 83 "impl/vhal_v2_0/CommConn.cpp", 84 "impl/vhal_v2_0/EmulatedVehicleConnector.cpp", 85 "impl/vhal_v2_0/EmulatedVehicleHal.cpp", 86 "impl/vhal_v2_0/VehicleHalClient.cpp", 87 "impl/vhal_v2_0/VehicleHalServer.cpp", 88 "impl/vhal_v2_0/VehicleEmulator.cpp", 89 "impl/vhal_v2_0/PipeComm.cpp", 90 "impl/vhal_v2_0/ProtoMessageConverter.cpp", 91 "impl/vhal_v2_0/SocketComm.cpp", 92 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", 93 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", 94 "impl/vhal_v2_0/GeneratorHub.cpp", 95 "impl/vhal_v2_0/qemu_pipe.cpp", 96 ], 97 local_include_dirs: ["common/include/vhal_v2_0"], 98 export_include_dirs: ["impl"], 99 whole_static_libs: [ 100 "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", 101 "android.hardware.automotive.vehicle@2.0-manager-lib", 102 ], 103 shared_libs: [ 104 "libbase", 105 "libjsoncpp", 106 "libprotobuf-cpp-lite", 107 ], 108 static_libs: [ 109 "android.hardware.automotive.vehicle@2.0-libproto-native", 110 ], 111} 112 113// Library used to emulate User HAL behavior through lshal debug requests. 114cc_library_static { 115 name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", 116 vendor: true, 117 defaults: ["vhal_v2_0_target_defaults"], 118 srcs: [ 119 "impl/vhal_v2_0/EmulatedUserHal.cpp", 120 ], 121 whole_static_libs: [ 122 "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib", 123 ], 124} 125 126// Vehicle HAL Server reference impl lib 127cc_library_static { 128 name: "android.hardware.automotive.vehicle@2.0-server-common-lib", 129 vendor: true, 130 host_supported: true, 131 defaults: ["vhal_v2_0_defaults"], 132 local_include_dirs: ["common/include/vhal_v2_0"], 133 export_include_dirs: ["common/include"], 134 srcs: [ 135 "common/src/Obd2SensorStore.cpp", 136 "common/src/VehicleObjectPool.cpp", 137 "common/src/VehiclePropertyStore.cpp", 138 "common/src/VehicleUtils.cpp", 139 ], 140} 141 142// Vehicle HAL Server default implementation 143cc_library_static { 144 name: "android.hardware.automotive.vehicle@2.0-server-impl-lib", 145 vendor: true, 146 host_supported: true, 147 defaults: ["vhal_v2_0_defaults"], 148 local_include_dirs: ["common/include/vhal_v2_0"], 149 export_include_dirs: ["impl"], 150 srcs: [ 151 "impl/vhal_v2_0/GeneratorHub.cpp", 152 "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", 153 "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", 154 "impl/vhal_v2_0/ProtoMessageConverter.cpp", 155 "impl/vhal_v2_0/VehicleHalServer.cpp", 156 ], 157 whole_static_libs: [ 158 "android.hardware.automotive.vehicle@2.0-server-common-lib", 159 "android.hardware.automotive.vehicle@2.0-user-hal-helper-lib", 160 ], 161 static_libs: [ 162 "android.hardware.automotive.vehicle@2.0-libproto-native", 163 ], 164 shared_libs: [ 165 "libbase", 166 "libjsoncpp", 167 ], 168} 169 170cc_test { 171 name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests", 172 vendor: true, 173 defaults: ["vhal_v2_0_target_defaults"], 174 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], 175 srcs: [ 176 "tests/RecurrentTimer_test.cpp", 177 "tests/SubscriptionManager_test.cpp", 178 "tests/VehicleHalManager_test.cpp", 179 "tests/VehicleObjectPool_test.cpp", 180 "tests/VehiclePropConfigIndex_test.cpp", 181 "tests/VmsUtils_test.cpp", 182 ], 183 shared_libs: [ 184 "libbase", 185 ], 186 header_libs: ["libbase_headers"], 187 test_suites: ["general-tests"], 188} 189 190cc_test { 191 name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests", 192 vendor: true, 193 defaults: ["vhal_v2_0_target_defaults"], 194 srcs: [ 195 "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", 196 ], 197 static_libs: [ 198 "android.hardware.automotive.vehicle@2.0-default-impl-lib", 199 "android.hardware.automotive.vehicle@2.0-libproto-native", 200 "libprotobuf-cpp-lite", 201 ], 202 test_suites: ["general-tests"], 203} 204 205cc_binary { 206 name: "android.hardware.automotive.vehicle@2.0-service", 207 defaults: ["vhal_v2_0_target_defaults"], 208 vintf_fragments: [ 209 "android.hardware.automotive.vehicle@2.0-service.xml", 210 ], 211 init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"], 212 vendor: true, 213 relative_install_path: "hw", 214 srcs: ["VehicleService.cpp"], 215 shared_libs: [ 216 "libbase", 217 "libjsoncpp", 218 "libprotobuf-cpp-lite", 219 ], 220 static_libs: [ 221 "android.hardware.automotive.vehicle@2.0-manager-lib", 222 "android.hardware.automotive.vehicle@2.0-default-impl-lib", 223 "android.hardware.automotive.vehicle@2.0-libproto-native", 224 ], 225} 226 227cc_fuzz { 228 name: "vehicleManager_fuzzer", 229 vendor: true, 230 defaults: ["vhal_v2_0_target_defaults"], 231 whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], 232 srcs: [ 233 "tests/fuzzer/VehicleManager_fuzzer.cpp", 234 ], 235 shared_libs: [ 236 "libbase", 237 "libcutils", 238 "libbinder_ndk", 239 ], 240 header_libs: ["libbase_headers"], 241 local_include_dirs: [ 242 "common/include", 243 "tests", 244 ], 245 fuzz_config: { 246 cc: [ 247 "android-media-fuzzing-reports@google.com", 248 ], 249 componentid: 533764, 250 }, 251} 252