1// Copyright (C) 2016 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_android_kernel", 17 default_applicable_licenses: ["system_libhidl_license"], 18} 19 20// Added automatically by a large-scale-change 21// See: http://go/android-license-faq 22license { 23 name: "system_libhidl_license", 24 visibility: [":__subpackages__"], 25 license_kinds: [ 26 "SPDX-license-identifier-Apache-2.0", 27 ], 28 license_text: [ 29 "NOTICE", 30 ], 31} 32 33cc_defaults { 34 name: "libhidl-defaults", 35 cflags: [ 36 "-Wall", 37 "-Wdocumentation", // since some users use this 38 "-Werror", 39 "-Wextra-semi", 40 ], 41} 42 43phony { 44 name: "libhidl", 45 required: [ 46 "libhidlbase", 47 ], 48} 49 50cc_library_headers { 51 name: "libhidl_gtest_helper", 52 vendor_available: true, 53 host_supported: true, 54 export_include_dirs: ["gtest_helper"], 55} 56 57cc_test { 58 name: "libhidl_test", 59 host_supported: true, 60 defaults: ["libhidl-defaults"], 61 gtest: false, 62 tidy_timeout_srcs: ["test_main.cpp"], 63 srcs: ["test_main.cpp"], 64 test_suites: ["device-tests"], 65 66 shared_libs: [ 67 "android.hidl.memory@1.0", 68 "libbase", 69 "libhidlbase", 70 "liblog", 71 "libutils", 72 "libcutils", 73 ], 74 static_libs: [ 75 "libgtest", 76 "libgmock", 77 ], 78 79 cflags: [ 80 "-O0", 81 "-g", 82 ], 83} 84 85cc_library { 86 name: "libhidlbase", 87 defaults: ["libhidlbase-combined-impl"], 88 host_supported: true, 89 // TODO(b/153609531): remove when no longer needed. 90 native_bridge_supported: true, 91 recovery_available: true, 92 vendor_available: true, 93 product_available: true, 94 apex_available: [ 95 // TODO(b/137948090): not fully supported in APEX for certain usecases 96 // - large dependency sizes 97 // - VINTF manifest cannot be read from APEX 98 // - no testing story/infra for deprecation schedule 99 "//apex_available:platform", 100 "com.android.neuralnetworks", 101 "com.android.bt", 102 "com.android.media", 103 "com.android.media.swcodec", 104 "com.android.nfcservices", 105 "com.android.tethering", 106 ], 107 double_loadable: true, 108 whole_static_libs: [ 109 "libhwbinder-impl-internal", 110 ], 111 min_sdk_version: "29", 112 afdo: true, 113} 114 115// WARNING: deprecated 116// This library is no longer required, and dependencies should be taken on libhidlbase instead. 117// This is automatically removed by bpfix. Once there are no makefiles, fixes can be automatically applied, and this can be removed. 118cc_library { 119 name: "libhidltransport", 120 vendor_available: true, 121 122 visibility: [ 123 ":__subpackages__", 124 "//hardware:__subpackages__", 125 "//test/sts:__subpackages__", 126 "//vendor:__subpackages__", 127 "//visibility:any_system_partition", 128 ], 129} 130 131cc_defaults { 132 name: "libhidlbase-combined-impl", 133 134 defaults: [ 135 "hidl-module-defaults", 136 "libhidl-defaults", 137 "libhwbinder-impl-shared-libs", 138 ], 139 140 shared_libs: [ 141 "libbase", 142 "liblog", 143 "libutils", 144 "libcutils", 145 ], 146 export_shared_lib_headers: [ 147 "libcutils", // for native_handle.h 148 "libutils", 149 ], 150 static_libs: [ 151 "libhwbinder-impl-internal", 152 ], 153 154 target: { 155 android: { 156 shared_libs: [ 157 "libvndksupport", 158 ], 159 }, 160 recovery: { 161 exclude_shared_libs: [ 162 "libvndksupport", 163 ], 164 }, 165 }, 166 167 export_include_dirs: [ 168 "base/include", 169 "transport/include", 170 ], 171 172 header_libs: [ 173 "libfmq-base", 174 ], 175 export_header_lib_headers: [ 176 "libfmq-base", 177 ], 178 179 generated_sources: [ 180 "android.hidl.manager@1.0_genc++", 181 "android.hidl.manager@1.1_genc++", 182 "android.hidl.manager@1.2_genc++", 183 "android.hidl.base@1.0_genc++", 184 ], 185 generated_headers: [ 186 "android.hidl.manager@1.0_genc++_headers", 187 "android.hidl.manager@1.1_genc++_headers", 188 "android.hidl.manager@1.2_genc++_headers", 189 "android.hidl.base@1.0_genc++_headers", 190 ], 191 export_generated_headers: [ 192 "android.hidl.manager@1.0_genc++_headers", 193 "android.hidl.manager@1.1_genc++_headers", 194 "android.hidl.manager@1.2_genc++_headers", 195 "android.hidl.base@1.0_genc++_headers", 196 ], 197 198 srcs: [ 199 "base/HidlInternal.cpp", 200 "base/HidlSupport.cpp", 201 "base/Status.cpp", 202 "base/TaskRunner.cpp", 203 "transport/HidlBinderSupport.cpp", 204 "transport/HidlLazyUtils.cpp", 205 "transport/HidlPassthroughSupport.cpp", 206 "transport/HidlTransportSupport.cpp", 207 "transport/HidlTransportUtils.cpp", 208 "transport/LegacySupport.cpp", 209 "transport/ServiceManagement.cpp", 210 "transport/Static.cpp", 211 ], 212 213 product_variables: { 214 debuggable: { 215 cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"], 216 }, 217 enforce_vintf_manifest: { 218 cflags: ["-DENFORCE_VINTF_MANIFEST"], 219 }, 220 }, 221 222 sanitize: { 223 misc_undefined: ["integer"], 224 }, 225} 226