1//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
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: "android.hardware.bluetooth@1.0-defaults",
27    vendor: true,
28    relative_install_path: "hw",
29    srcs: [
30        "bluetooth_hci.cc",
31        "bluetooth_address.cc",
32        "vendor_interface.cc",
33    ],
34    shared_libs: [
35        "android.hardware.bluetooth@1.0",
36        "libbase",
37        "libcutils",
38        "libhardware",
39        "libhidlbase",
40        "liblog",
41        "libutils",
42    ],
43    static_libs: [
44        "android.hardware.bluetooth-async",
45        "android.hardware.bluetooth-hci",
46    ],
47}
48
49cc_library {
50    name: "android.hardware.bluetooth@1.0-impl",
51    defaults: [
52        "hidl_defaults",
53        "android.hardware.bluetooth@1.0-defaults",
54    ],
55}
56
57cc_library {
58    name: "android.hardware.bluetooth@1.0-impl-test",
59    defaults: [
60        "hidl_defaults",
61        "android.hardware.bluetooth@1.0-defaults",
62    ],
63    cflags: [
64        "-DBT_FUZZER",
65    ],
66}
67
68cc_library_static {
69    name: "android.hardware.bluetooth-async",
70    vendor: true,
71    defaults: ["hidl_defaults"],
72    srcs: [
73        "async_fd_watcher.cc",
74    ],
75    export_include_dirs: ["."],
76    shared_libs: [
77        "liblog",
78    ],
79}
80
81cc_library_static {
82    name: "android.hardware.bluetooth-hci",
83    vendor: true,
84    defaults: ["hidl_defaults"],
85    srcs: [
86        "hci_packetizer.cc",
87        "hci_protocol.cc",
88        "h4_protocol.cc",
89        "mct_protocol.cc",
90    ],
91    export_include_dirs: ["."],
92    shared_libs: [
93        "libbase",
94        "libhidlbase",
95        "liblog",
96        "libutils",
97    ],
98}
99
100cc_test {
101    name: "bluetooth-vendor-interface-unit-tests",
102    vendor: true,
103    defaults: ["hidl_defaults"],
104    srcs: [
105        "test/async_fd_watcher_unittest.cc",
106        "test/h4_protocol_unittest.cc",
107        "test/mct_protocol_unittest.cc",
108    ],
109    local_include_dirs: [
110        "test",
111    ],
112    shared_libs: [
113        "libbase",
114        "libhidlbase",
115        "liblog",
116        "libutils",
117    ],
118    static_libs: [
119        "android.hardware.bluetooth-async",
120        "android.hardware.bluetooth-hci",
121        "libgmock",
122    ],
123    test_suites: ["general-tests"],
124}
125
126cc_test_host {
127    name: "bluetooth-address-unit-tests",
128    defaults: ["hidl_defaults"],
129    srcs: [
130        "bluetooth_address.cc",
131        "test/bluetooth_address_test.cc",
132    ],
133    local_include_dirs: [
134        "test",
135    ],
136    shared_libs: [
137        "libbase",
138        "libcutils",
139        "liblog",
140    ],
141}
142
143cc_binary {
144    name: "android.hardware.bluetooth@1.0-service",
145    defaults: ["hidl_defaults"],
146    relative_install_path: "hw",
147    vendor: true,
148    init_rc: ["android.hardware.bluetooth@1.0-service.rc"],
149    srcs: ["service.cpp"],
150
151    shared_libs: [
152        "liblog",
153        "libcutils",
154        "libdl",
155        "libbase",
156        "libutils",
157        "libhardware",
158        "libhidlbase",
159        "android.hardware.bluetooth@1.0",
160    ],
161}
162