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        "-Wno-date-time",
39    ],
40    generated_headers: [
41        "HeadlessBuildTimestamp",
42    ],
43    srcs: [
44        "adapter/adapter.cc",
45        "bt_stack_info.cc",
46        "connect/connect.cc",
47        "discovery/discovery.cc",
48        "dumpsys/dumpsys.cc",
49        "get_options.cc",
50        "handler.cc",
51        "headless.cc",
52        "log.cc",
53        "main.cc",
54        "messenger.cc",
55        "mode/mode.cc",
56        "nop/nop.cc",
57        "pairing/pairing.cc",
58        "property.cc",
59        "read/name.cc",
60        "read/read.cc",
61        "scan/scan.cc",
62        "sdp/sdp.cc",
63        "sdp/sdp_db.cc",
64        "text.cc",
65        "util.cc",
66    ],
67    include_dirs: [
68        "packages/modules/Bluetooth/system",
69        "packages/modules/Bluetooth/system/gd",
70        "packages/modules/Bluetooth/system/include",
71        "packages/modules/Bluetooth/system/stack/include",
72    ],
73    static_libs: [
74        "aics",
75        "[email protected]",
76        "android.hardware.common-V2-ndk",
77        "android.hardware.common.fmq-V1-ndk",
78        "avrcp-target-service",
79        "bluetooth_flags_c_lib",
80        "lib-bt-packets",
81        "lib-bt-packets-avrcp",
82        "lib-bt-packets-base",
83        "libFraunhoferAAC",
84        "libbase",
85        "libbluetooth-types",
86        "libbluetooth_core_rs",
87        "libbluetooth_crypto_toolbox",
88        "libbluetooth_gd",
89        "libbluetooth_log",
90        "libbt-audio-asrc",
91        "libbt-audio-hal-interface",
92        "libbt-bta",
93        "libbt-bta-core",
94        "libbt-btu-main-thread",
95        "libbt-common",
96        "libbt-hci",
97        "libbt-jni-thread",
98        "libbt-sbc-decoder",
99        "libbt-sbc-encoder",
100        "libbt-stack",
101        "libbt-stack-core",
102        "libbtcore",
103        "libbtdevice",
104        "libbte",
105        "libbtif",
106        "libbtif-core",
107        "libchrome",
108        "libcom.android.sysprop.bluetooth.wrapped",
109        "libevent",
110        "libflags_rust_cpp_bridge",
111        "libflatbuffers-cpp",
112        "libfmq",
113        "libg722codec",
114        "liblc3",
115        "libmodpb64",
116        "libopus",
117        "libosi",
118        "libprotobuf-cpp-lite",
119        "libstatslog_bt",
120        "libudrv-uipc",
121        "libz",
122    ],
123    aidl: {
124        libs: ["bluetooth_constants"],
125    },
126    shared_libs: [
127        "libPlatformProperties",
128        "libaconfig_storage_read_api_cc",
129        "libbinder",
130        "libcrypto",
131        "libcutils", // property_get_bool
132        "libhidlbase",
133        "libjsoncpp",
134        "liblog", // __android_log_print
135        "libutils",
136        "server_configurable_flags",
137    ],
138    header_libs: ["libbluetooth_headers"],
139    target: {
140        android: {
141            static_libs: [
142                "[email protected]",
143                "[email protected]",
144                "[email protected]",
145                "[email protected]",
146                "android.system.suspend.control-V1-ndk",
147                "libexpresslog",
148                "libstatslog_express",
149                "libtextclassifier_hash_static",
150            ],
151            shared_libs: [
152                "android.system.suspend-V1-ndk",
153                "libaaudio",
154                "libbinder_ndk",
155                "libstatssocket",
156            ],
157        },
158        host: {
159            static_libs: [
160                "[email protected]",
161                "[email protected]",
162                "libbinder_ndk",
163            ],
164        },
165    },
166}
167