Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 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 | |
Bob Badour | c22b35b | 2021-02-23 14:26:20 -0800 | [diff] [blame] | 15 | package { |
| 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 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 24 | cc_defaults { |
| 25 | name: "vhal_v2_0_defaults", |
| 26 | shared_libs: [ |
| 27 | "libhidlbase", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 28 | "liblog", |
| 29 | "libutils", |
| 30 | "android.hardware.automotive.vehicle@2.0", |
| 31 | ], |
| 32 | cflags: [ |
| 33 | "-Wall", |
| 34 | "-Wextra", |
| 35 | "-Werror", |
| 36 | ], |
| 37 | } |
| 38 | |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 39 | cc_defaults { |
| 40 | name: "vhal_v2_0_target_defaults", |
| 41 | defaults: ["vhal_v2_0_defaults"], |
| 42 | shared_libs: [ |
| 43 | "libbinder_ndk", |
Jeongik Cha | 3853391 | 2021-01-28 00:49:49 +0900 | [diff] [blame] | 44 | "android.automotive.watchdog-V2-ndk_platform", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 45 | ], |
| 46 | } |
| 47 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 48 | cc_library_headers { |
| 49 | name: "vhal_v2_0_common_headers", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 50 | visibility: ["//visibility:public"], |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 51 | vendor: true, |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 52 | export_include_dirs: ["common/include/vhal_v2_0"], |
| 53 | } |
| 54 | |
| 55 | // Vehicle reference implementation lib |
Anthony Mah | a9d8c0d | 2017-10-03 16:22:22 -0700 | [diff] [blame] | 56 | cc_library { |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 57 | name: "android.hardware.automotive.vehicle@2.0-manager-lib", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 58 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 59 | defaults: ["vhal_v2_0_target_defaults"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 60 | srcs: [ |
Pavel Maltsev | 250139c | 2017-08-24 15:09:41 -0700 | [diff] [blame] | 61 | "common/src/Obd2SensorStore.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 62 | "common/src/ProtoMessageConverter.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 63 | "common/src/SubscriptionManager.cpp", |
| 64 | "common/src/VehicleHalManager.cpp", |
| 65 | "common/src/VehicleObjectPool.cpp", |
| 66 | "common/src/VehiclePropertyStore.cpp", |
| 67 | "common/src/VehicleUtils.cpp", |
Aditi Nagaraj | 8dcab8e | 2018-01-10 17:10:01 -0800 | [diff] [blame] | 68 | "common/src/VmsUtils.cpp", |
Eric Jeong | 908101a | 2020-04-23 09:43:55 -0700 | [diff] [blame] | 69 | "common/src/WatchdogClient.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 70 | ], |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 71 | shared_libs: [ |
| 72 | "libbase", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 73 | "libprotobuf-cpp-lite", |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 74 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 75 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 76 | export_include_dirs: ["common/include"], |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 77 | static_libs: [ |
| 78 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 79 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 80 | } |
| 81 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 82 | // Vehicle default VehicleHAL implementation |
| 83 | cc_library_static { |
| 84 | name: "android.hardware.automotive.vehicle@2.0-default-impl-lib", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 85 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 86 | defaults: ["vhal_v2_0_target_defaults"], |
Yuncheol Heo | 38ec240 | 2021-04-15 15:25:39 -0700 | [diff] [blame] | 87 | cflags: ["-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 88 | srcs: [ |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 89 | "impl/vhal_v2_0/DefaultVehicleHal.cpp", |
Hao Chen | a6d6fa3 | 2020-02-14 11:51:26 -0800 | [diff] [blame] | 90 | "impl/vhal_v2_0/VehicleHalClient.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 91 | "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", |
Chao Yan | f63c2ca | 2018-04-17 11:32:39 -0700 | [diff] [blame] | 92 | "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", |
| 93 | "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", |
Chao Yan | 0f85dd1 | 2018-06-04 14:03:02 -0700 | [diff] [blame] | 94 | "impl/vhal_v2_0/GeneratorHub.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 95 | ], |
| 96 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 97 | export_include_dirs: ["impl"], |
felipeal | 9c998c0 | 2020-04-17 14:32:53 -0700 | [diff] [blame] | 98 | whole_static_libs: [ |
felipeal | 9c998c0 | 2020-04-17 14:32:53 -0700 | [diff] [blame] | 99 | "android.hardware.automotive.vehicle@2.0-manager-lib", |
| 100 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 101 | shared_libs: [ |
| 102 | "libbase", |
Inseob Kim | 31ab19f | 2019-09-10 14:56:19 +0900 | [diff] [blame] | 103 | "libjsoncpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 104 | "libprotobuf-cpp-lite", |
| 105 | ], |
| 106 | static_libs: [ |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 107 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 108 | ], |
| 109 | } |
| 110 | |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 111 | // Vehicle HAL Server reference impl lib |
| 112 | cc_library_static { |
| 113 | name: "android.hardware.automotive.vehicle@2.0-server-common-lib", |
| 114 | vendor: true, |
| 115 | host_supported: true, |
| 116 | defaults: ["vhal_v2_0_defaults"], |
| 117 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 118 | export_include_dirs: ["common/include"], |
| 119 | srcs: [ |
| 120 | "common/src/Obd2SensorStore.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 121 | "common/src/ProtoMessageConverter.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 122 | "common/src/VehicleObjectPool.cpp", |
Hao Chen | 0b7c287 | 2021-05-12 12:21:33 -0700 | [diff] [blame] | 123 | "common/src/VehiclePropertyStore.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 124 | "common/src/VehicleUtils.cpp", |
| 125 | ], |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 126 | static_libs: [ |
| 127 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 128 | ], |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | // Vehicle HAL Server default implementation |
| 132 | cc_library_static { |
| 133 | name: "android.hardware.automotive.vehicle@2.0-server-impl-lib", |
| 134 | vendor: true, |
| 135 | host_supported: true, |
| 136 | defaults: ["vhal_v2_0_defaults"], |
| 137 | local_include_dirs: ["common/include/vhal_v2_0"], |
| 138 | export_include_dirs: ["impl"], |
| 139 | srcs: [ |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 140 | "impl/vhal_v2_0/GeneratorHub.cpp", |
| 141 | "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", |
| 142 | "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", |
Yu Shan | 6029a37 | 2021-06-22 19:11:05 -0700 | [diff] [blame] | 143 | "impl/vhal_v2_0/DefaultVehicleHalServer.cpp", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 144 | ], |
| 145 | whole_static_libs: [ |
| 146 | "android.hardware.automotive.vehicle@2.0-server-common-lib", |
| 147 | ], |
| 148 | static_libs: [ |
| 149 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
| 150 | ], |
| 151 | shared_libs: [ |
| 152 | "libbase", |
| 153 | "libjsoncpp", |
| 154 | ], |
| 155 | } |
| 156 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 157 | cc_test { |
| 158 | name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests", |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 159 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 160 | defaults: ["vhal_v2_0_target_defaults"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 161 | whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], |
| 162 | srcs: [ |
| 163 | "tests/RecurrentTimer_test.cpp", |
| 164 | "tests/SubscriptionManager_test.cpp", |
| 165 | "tests/VehicleHalManager_test.cpp", |
| 166 | "tests/VehicleObjectPool_test.cpp", |
| 167 | "tests/VehiclePropConfigIndex_test.cpp", |
Aditi Nagaraj | 8dcab8e | 2018-01-10 17:10:01 -0800 | [diff] [blame] | 168 | "tests/VmsUtils_test.cpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 169 | ], |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 170 | shared_libs: [ |
| 171 | "libbase", |
Yu Shan | 8ae3ea9 | 2021-06-01 15:44:43 -0700 | [diff] [blame] | 172 | "libcutils", |
Felipe Leme | 75a27f8 | 2020-01-31 15:25:55 -0800 | [diff] [blame] | 173 | ], |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 174 | // Exclude share libraries from default because they might be missing on |
| 175 | // some test platforms and we are using static libraries instead. |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 176 | exclude_shared_libs: [ |
| 177 | "android.automotive.watchdog-V2-ndk_platform", |
| 178 | "android.hardware.automotive.vehicle@2.0", |
| 179 | ], |
| 180 | static_libs: [ |
| 181 | "android.automotive.watchdog-V2-ndk_platform", |
| 182 | "android.hardware.automotive.vehicle@2.0", |
| 183 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 184 | header_libs: ["libbase_headers"], |
Keun Soo YIM | ff84c37 | 2018-11-27 14:04:42 -0800 | [diff] [blame] | 185 | test_suites: ["general-tests"], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 188 | cc_test { |
| 189 | name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests", |
| 190 | vendor: true, |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 191 | defaults: ["vhal_v2_0_target_defaults"], |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 192 | srcs: [ |
| 193 | "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 194 | "impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp", |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 195 | ], |
| 196 | static_libs: [ |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 197 | "libbase", |
| 198 | "libcutils", |
Yu Shan | 795f4de | 2021-07-01 15:41:19 -0700 | [diff] [blame] | 199 | "libgmock", |
Yu Shan | 3984457 | 2021-06-23 20:42:24 -0700 | [diff] [blame] | 200 | "libjsoncpp", |
| 201 | "libprotobuf-cpp-lite", |
| 202 | ], |
| 203 | // Exclude share libraries from default because they might be missing on |
| 204 | // some test platforms and we are using static libraries instead. |
| 205 | exclude_shared_libs: [ |
| 206 | "android.automotive.watchdog-V2-ndk_platform", |
| 207 | "android.hardware.automotive.vehicle@2.0", |
| 208 | ], |
| 209 | whole_static_libs: [ |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 210 | "android.automotive.watchdog-V2-ndk_platform", |
| 211 | "android.hardware.automotive.vehicle@2.0", |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 212 | "android.hardware.automotive.vehicle@2.0-default-impl-lib", |
| 213 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
Yu Shan | 045138d | 2021-06-02 16:15:29 -0700 | [diff] [blame] | 214 | ], |
Yu Shan | 4a23901 | 2021-07-20 18:12:53 -0700 | [diff] [blame^] | 215 | data: [ |
| 216 | ":vhal_test_override_json", |
| 217 | ":vhal_test_json", |
| 218 | ], |
Hao Chen | 1c1fdca | 2019-11-15 14:20:34 -0800 | [diff] [blame] | 219 | test_suites: ["general-tests"], |
| 220 | } |
| 221 | |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 222 | cc_binary { |
| 223 | name: "android.hardware.automotive.vehicle@2.0-service", |
Hao Chen | c324db9 | 2020-06-03 18:29:31 -0700 | [diff] [blame] | 224 | defaults: ["vhal_v2_0_target_defaults"], |
Calvin Huang | a653616 | 2020-04-20 12:41:20 -0700 | [diff] [blame] | 225 | vintf_fragments: [ |
| 226 | "android.hardware.automotive.vehicle@2.0-service.xml", |
| 227 | ], |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 228 | init_rc: ["android.hardware.automotive.vehicle@2.0-service.rc"], |
Tri Vo | 22b2d68 | 2017-07-11 12:53:12 -0700 | [diff] [blame] | 229 | vendor: true, |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 230 | relative_install_path: "hw", |
| 231 | srcs: ["VehicleService.cpp"], |
| 232 | shared_libs: [ |
| 233 | "libbase", |
Inseob Kim | 31ab19f | 2019-09-10 14:56:19 +0900 | [diff] [blame] | 234 | "libjsoncpp", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 235 | "libprotobuf-cpp-lite", |
| 236 | ], |
| 237 | static_libs: [ |
| 238 | "android.hardware.automotive.vehicle@2.0-manager-lib", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 239 | "android.hardware.automotive.vehicle@2.0-libproto-native", |
Yu Shan | 795f4de | 2021-07-01 15:41:19 -0700 | [diff] [blame] | 240 | "android.hardware.automotive.vehicle@2.0-emulator-impl-lib", |
Tri Vo | fc87140 | 2017-07-10 17:13:23 -0700 | [diff] [blame] | 241 | ], |
| 242 | } |
Ayushi Khopkar | b3057b0 | 2020-08-31 10:59:52 +0530 | [diff] [blame] | 243 | |
| 244 | cc_fuzz { |
| 245 | name: "vehicleManager_fuzzer", |
| 246 | vendor: true, |
| 247 | defaults: ["vhal_v2_0_target_defaults"], |
| 248 | whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], |
| 249 | srcs: [ |
| 250 | "tests/fuzzer/VehicleManager_fuzzer.cpp", |
| 251 | ], |
| 252 | shared_libs: [ |
| 253 | "libbase", |
| 254 | "libcutils", |
| 255 | "libbinder_ndk", |
| 256 | ], |
| 257 | header_libs: ["libbase_headers"], |
| 258 | local_include_dirs: [ |
| 259 | "common/include", |
| 260 | "tests", |
| 261 | ], |
| 262 | fuzz_config: { |
| 263 | cc: [ |
| 264 | "android-media-fuzzing-reports@google.com", |
| 265 | ], |
| 266 | componentid: 533764, |
| 267 | }, |
| 268 | } |