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