1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_bt_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["system_bt_license"],
8}
9
10sh_binary {
11    name: "headless_build_timestamp",
12    host_supported: true,
13    src: "tools/build_timestamp.sh",
14}
15
16genrule {
17    name: "HeadlessBuildTimestamp",
18    tools: [
19        "headless_build_timestamp",
20    ],
21    cmd: "$(location headless_build_timestamp) > $(out)",
22    out: [
23        "build_timestamp.h",
24    ],
25}
26
27cc_binary {
28    name: "bt_headless",
29    host_supported: true,
30    defaults: [
31        "fluoride_defaults",
32        "latest_android_hardware_audio_common_ndk_static",
33        "latest_android_hardware_bluetooth_audio_ndk_android_static",
34        "latest_android_hardware_bluetooth_audio_ndk_static",
35        "latest_android_media_audio_common_types_ndk_static",
36    ],
37    cflags: [
38        "-Wall",
39        "-Werror",
40        "-Wextra",
41        "-Wno-date-time",
42    ],
43    generated_headers: [
44        "HeadlessBuildTimestamp",
45    ],
46    srcs: [
47        "adapter/adapter.cc",
48        "bt_stack_info.cc",
49        "connect/connect.cc",
50        "discovery/discovery.cc",
51        "dumpsys/dumpsys.cc",
52        "get_options.cc",
53        "handler.cc",
54        "headless.cc",
55        "log.cc",
56        "main.cc",
57        "messenger.cc",
58        "mode/mode.cc",
59        "nop/nop.cc",
60        "pairing/pairing.cc",
61        "property.cc",
62        "read/name.cc",
63        "read/read.cc",
64        "scan/scan.cc",
65        "sdp/sdp.cc",
66        "sdp/sdp_db.cc",
67        "text.cc",
68        "util.cc",
69    ],
70    include_dirs: [
71        "packages/modules/Bluetooth/system",
72        "packages/modules/Bluetooth/system/gd",
73        "packages/modules/Bluetooth/system/include",
74        "packages/modules/Bluetooth/system/stack/include",
75    ],
76    static_libs: [
77        "android.hardware.audio.common@5.0",
78        "android.hardware.bluetooth.a2dp@1.0",
79        "android.hardware.common-V2-ndk",
80        "android.hardware.common.fmq-V1-ndk",
81        "avrcp-target-service",
82        "lib-bt-packets",
83        "lib-bt-packets-avrcp",
84        "lib-bt-packets-base",
85        "libFraunhoferAAC",
86        "libaudio-a2dp-hw-utils",
87        "libbase",
88        "libbluetooth-dumpsys",
89        "libbluetooth-gdx",
90        "libbluetooth-types",
91        "libbluetooth_core_rs",
92        "libbluetooth_crypto_toolbox",
93        "libbluetooth_gd",
94        "libbluetooth_log",
95        "libbluetooth_rust_interop",
96        "libbt-audio-asrc",
97        "libbt-audio-hal-interface",
98        "libbt-bta",
99        "libbt-bta-core",
100        "libbt-btu-main-thread",
101        "libbt-common",
102        "libbt-hci",
103        "libbt-jni-thread",
104        "libbt-sbc-decoder",
105        "libbt-sbc-encoder",
106        "libbt-stack",
107        "libbt-stack-core",
108        "libbt_shim_bridge",
109        "libbt_shim_ffi",
110        "libbtcore",
111        "libbtdevice",
112        "libbte",
113        "libbtif",
114        "libbtif-core",
115        "libchrome",
116        "libevent",
117        "libflatbuffers-cpp",
118        "libfmq",
119        "libg722codec",
120        "liblc3",
121        "libmodpb64",
122        "libopus",
123        "libosi",
124        "libprotobuf-cpp-lite",
125        "libstatslog_bt",
126        "libudrv-uipc",
127        "libz",
128    ],
129    shared_libs: [
130        "libPlatformProperties",
131        "libaconfig_storage_read_api_cc",
132        "libcrypto",
133        "libcutils", // property_get_bool
134        "libhidlbase",
135        "libjsoncpp",
136        "liblog", // __android_log_print
137        "libutils",
138        "server_configurable_flags",
139    ],
140    header_libs: ["libbluetooth_headers"],
141    target: {
142        android: {
143            static_libs: [
144                "android.hardware.bluetooth.audio@2.0",
145                "android.hardware.bluetooth.audio@2.1",
146                "android.hardware.bluetooth@1.0",
147                "android.hardware.bluetooth@1.1",
148                "android.system.suspend.control-V1-ndk",
149            ],
150            shared_libs: [
151                "android.system.suspend-V1-ndk",
152                "libaaudio",
153                "libbinder_ndk",
154                "libstatssocket",
155            ],
156        },
157        host: {
158            static_libs: [
159                "android.hardware.bluetooth.audio@2.0",
160                "android.hardware.bluetooth.audio@2.1",
161                "libbinder_ndk",
162            ],
163        },
164    },
165}
166