blob: 6d1da63a6893c409d4a4bf72863e1b7a28f5ebb3 [file] [log] [blame]
Bob Badourb224b362021-02-12 20:13:01 -08001package {
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 "hardware_interfaces_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["hardware_interfaces_license"],
8}
9
Jakub Pawlowski964f3232021-02-02 15:11:39 +010010cc_library_shared {
11 name: "libbluetooth_audio_session",
12 defaults: ["hidl_defaults"],
13 vendor: true,
14 srcs: [
15 "session/BluetoothAudioSession.cpp",
Jakub Pawlowski3c8dc612021-02-03 20:43:20 +010016 "session/BluetoothAudioSession_2_1.cpp",
Jakub Pawlowski964f3232021-02-02 15:11:39 +010017 "session/BluetoothAudioSupportedCodecsDB.cpp",
Jakub Pawlowski3c8dc612021-02-03 20:43:20 +010018 "session/BluetoothAudioSupportedCodecsDB_2_1.cpp",
Jakub Pawlowski964f3232021-02-02 15:11:39 +010019 ],
20 export_include_dirs: ["session/"],
21 header_libs: ["libhardware_headers"],
22 shared_libs: [
Jakub Pawlowski8d87eb72021-12-06 15:22:03 +010023 "android.hardware.audio.common@5.0",
Jakub Pawlowski964f3232021-02-02 15:11:39 +010024 "android.hardware.bluetooth.audio@2.0",
Jakub Pawlowski3c8dc612021-02-03 20:43:20 +010025 "android.hardware.bluetooth.audio@2.1",
Jakub Pawlowski964f3232021-02-02 15:11:39 +010026 "libbase",
27 "libcutils",
28 "libfmq",
29 "libhidlbase",
30 "liblog",
31 "libutils",
Josh Wu20bac522021-12-29 23:52:39 -080032 "libbluetooth_audio_session_aidl",
33 ],
34}
35
36cc_library_shared {
37 name: "libbluetooth_audio_session_aidl",
38 vendor: true,
Yung Ti Sufefceb12023-08-22 09:29:06 +000039 host_supported: true,
Josh Wu20bac522021-12-29 23:52:39 -080040 srcs: [
41 "aidl_session/BluetoothAudioCodecs.cpp",
42 "aidl_session/BluetoothAudioSession.cpp",
43 "aidl_session/HidlToAidlMiddleware.cpp",
shihchienc8ed901a2022-09-06 08:44:44 +000044 "aidl_session/BluetoothLeAudioCodecsProvider.cpp",
Bao Do2fa1ab42024-01-29 17:50:34 +080045 "aidl_session/BluetoothHfpCodecsProvider.cpp",
Bao Dofbc99e02023-11-15 03:21:03 +000046 "aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp",
Josh Wu20bac522021-12-29 23:52:39 -080047 ],
48 export_include_dirs: ["aidl_session/"],
shihchienc8ed901a2022-09-06 08:44:44 +000049 header_libs: [
50 "libhardware_headers",
51 "libxsdc-utils",
52 ],
Shunkai Yao195d3d62023-10-10 19:26:07 +000053 defaults: [
Ted Bauerda932132024-04-24 00:47:13 +000054 "aconfig_lib_cc_static_link.defaults",
Shunkai Yao195d3d62023-10-10 19:26:07 +000055 "latest_android_hardware_bluetooth_audio_ndk_shared",
56 ],
Josh Wu20bac522021-12-29 23:52:39 -080057 shared_libs: [
58 "android.hardware.bluetooth.audio@2.0",
59 "android.hardware.bluetooth.audio@2.1",
Josh Wu20bac522021-12-29 23:52:39 -080060 "libbase",
61 "libcutils",
62 "libbinder_ndk",
63 "libfmq",
64 "liblog",
Josh Wu20bac522021-12-29 23:52:39 -080065 "libhidlbase",
shihchienc8ed901a2022-09-06 08:44:44 +000066 "libxml2",
Bao Dofbc99e02023-11-15 03:21:03 +000067 "libflatbuffers-cpp",
Limon Miab58cee42023-12-01 12:16:00 +000068 "server_configurable_flags",
69 ],
70 static_libs: [
71 "btaudiohal_flags_c_lib",
Jakub Pawlowski964f3232021-02-02 15:11:39 +010072 ],
Bao Do2fa1ab42024-01-29 17:50:34 +080073 generated_sources: [
74 "le_audio_codec_capabilities",
75 "hfp_codec_capabilities",
76 ],
Bao Dofbc99e02023-11-15 03:21:03 +000077 generated_headers: [
78 "le_audio_codec_capabilities",
Bao Do2fa1ab42024-01-29 17:50:34 +080079 "hfp_codec_capabilities",
Bao Dofbc99e02023-11-15 03:21:03 +000080 "AIDLLeAudioSetConfigSchemas_h",
81 ],
Bao Dobe994192023-11-15 03:34:00 +000082 required: [
83 "aidl_audio_set_configurations_bfbs",
Bao Dof6ce19d2024-07-04 11:07:02 +080084 "aidl_default_audio_set_configurations_json",
Bao Dobe994192023-11-15 03:34:00 +000085 "aidl_audio_set_scenarios_bfbs",
Bao Dof6ce19d2024-07-04 11:07:02 +080086 "aidl_default_audio_set_scenarios_json",
Bao Do2fa1ab42024-01-29 17:50:34 +080087 "hfp_codec_capabilities_xml",
Bao Dobe994192023-11-15 03:34:00 +000088 ],
shihchienc8ed901a2022-09-06 08:44:44 +000089}
90
shihchiencd7f565a2022-10-14 13:45:37 +000091cc_test {
92 name: "BluetoothLeAudioCodecsProviderTest",
Bao Do35426be2024-04-17 14:37:11 +080093 defaults: [
94 "latest_android_hardware_audio_common_ndk_static",
95 "latest_android_hardware_bluetooth_audio_ndk_static",
96 "latest_android_media_audio_common_types_ndk_static",
97 ],
Bao Do39001812024-10-16 10:08:53 +080098 srcs: [
99 "aidl_session/BluetoothLeAudioCodecsProvider.cpp",
100 "aidl_session/BluetoothLeAudioCodecsProviderTest.cpp",
101 ],
shihchiencd7f565a2022-10-14 13:45:37 +0000102 header_libs: [
103 "libxsdc-utils",
104 ],
105 shared_libs: [
106 "libbase",
107 "libbinder_ndk",
shihchiencd7f565a2022-10-14 13:45:37 +0000108 "libxml2",
109 ],
110 test_suites: [
111 "general-tests",
112 ],
113 test_options: {
114 unit_test: false,
115 },
116 generated_sources: ["le_audio_codec_capabilities"],
117 generated_headers: ["le_audio_codec_capabilities"],
118}
119
Bao Doe062de72024-02-20 15:45:24 +0800120cc_test {
121 name: "BluetoothHfpCodecsProviderTest",
122 defaults: [
123 "latest_android_hardware_audio_common_ndk_static",
124 "latest_android_hardware_bluetooth_audio_ndk_static",
125 "latest_android_media_audio_common_types_ndk_static",
126 ],
127 srcs: [
128 "aidl_session/BluetoothHfpCodecsProvider.cpp",
129 "aidl_session/BluetoothHfpCodecsProviderTest.cpp",
130 ],
131 header_libs: [
132 "libxsdc-utils",
133 ],
134 shared_libs: [
135 "libbase",
136 "libbinder_ndk",
137 "libxml2",
138 ],
139 test_suites: [
140 "general-tests",
141 ],
142 test_options: {
143 unit_test: false,
144 },
145 generated_sources: ["hfp_codec_capabilities"],
146 generated_headers: ["hfp_codec_capabilities"],
147}
148
shihchienc8ed901a2022-09-06 08:44:44 +0000149xsd_config {
150 name: "le_audio_codec_capabilities",
151 srcs: ["le_audio_codec_capabilities/le_audio_codec_capabilities.xsd"],
152 package_name: "aidl.android.hardware.bluetooth.audio.setting",
153 api_dir: "le_audio_codec_capabilities/schema",
Jooyung Han16d5af62023-05-22 16:36:26 +0900154 root_elements: ["leAudioOffloadSetting"],
Jakub Pawlowski964f3232021-02-02 15:11:39 +0100155}
Bao Dofbc99e02023-11-15 03:21:03 +0000156
Bao Do2fa1ab42024-01-29 17:50:34 +0800157xsd_config {
158 name: "hfp_codec_capabilities",
159 srcs: ["hfp_codec_capabilities/hfp_codec_capabilities.xsd"],
160 package_name: "aidl.android.hardware.bluetooth.audio.hfp.setting",
161 api_dir: "hfp_codec_capabilities/schema",
162 root_elements: ["hfpOffloadSetting"],
163}
164
Bao Dofbc99e02023-11-15 03:21:03 +0000165genrule {
166 name: "AIDLLeAudioSetConfigSchemas_h",
167 tools: [
168 "flatc",
169 ],
170 cmd: "$(location flatc) -I hardware/interfaces/bluetooth/audio/utils/ -o $(genDir) --cpp $(in) ",
171 srcs: [
172 "le_audio_configuration_set/audio_set_configurations.fbs",
173 "le_audio_configuration_set/audio_set_scenarios.fbs",
174 ],
175 out: [
176 "audio_set_configurations_generated.h",
177 "audio_set_scenarios_generated.h",
178 ],
179}
180
181// Binary generation
182genrule {
183 name: "AIDLLeAudioSetScenariosSchema_bfbs",
184 tools: [
185 "flatc",
186 ],
187 cmd: "$(location flatc) -I hardware/interfaces/bluetooth/audio/utils/ -b --schema -o $(genDir) $(in) ",
188 srcs: [
189 "le_audio_configuration_set/audio_set_scenarios.fbs",
190 ],
191 out: [
192 "audio_set_scenarios.bfbs",
193 ],
194}
195
196genrule {
197 name: "AIDLLeAudioSetConfigsSchema_bfbs",
198 tools: [
199 "flatc",
200 ],
201 cmd: "$(location flatc) -I hardware/interfaces/bluetooth/audio/utils/ -b --schema -o $(genDir) $(in) ",
202 srcs: [
203 "le_audio_configuration_set/audio_set_configurations.fbs",
204 ],
205 out: [
206 "audio_set_configurations.bfbs",
207 ],
208}
209
210// Add to prebuilt etc
211prebuilt_etc {
212 name: "aidl_audio_set_scenarios_bfbs",
213 src: ":AIDLLeAudioSetScenariosSchema_bfbs",
214 filename: "aidl_audio_set_scenarios.bfbs",
215 sub_dir: "aidl/le_audio",
Bao Dobe994192023-11-15 03:34:00 +0000216 vendor: true,
Bao Dofbc99e02023-11-15 03:21:03 +0000217}
218
219prebuilt_etc {
Bao Dof6ce19d2024-07-04 11:07:02 +0800220 name: "aidl_default_audio_set_scenarios_json",
Bao Dofbc99e02023-11-15 03:21:03 +0000221 src: "le_audio_configuration_set/audio_set_scenarios.json",
Bao Dof6ce19d2024-07-04 11:07:02 +0800222 filename: "aidl_default_audio_set_scenarios.json",
Bao Dofbc99e02023-11-15 03:21:03 +0000223 sub_dir: "aidl/le_audio",
Bao Dobe994192023-11-15 03:34:00 +0000224 vendor: true,
Bao Dofbc99e02023-11-15 03:21:03 +0000225}
226
227prebuilt_etc {
Bao Do2fa1ab42024-01-29 17:50:34 +0800228 name: "hfp_codec_capabilities_xml",
229 src: "hfp_codec_capabilities/hfp_codec_capabilities.xml",
230 filename: "hfp_codec_capabilities.xml",
231 sub_dir: "aidl/hfp",
232 vendor: true,
233}
234
235prebuilt_etc {
Bao Dofbc99e02023-11-15 03:21:03 +0000236 name: "aidl_audio_set_configurations_bfbs",
237 src: ":AIDLLeAudioSetConfigsSchema_bfbs",
238 filename: "aidl_audio_set_configurations.bfbs",
239 sub_dir: "aidl/le_audio",
Bao Dobe994192023-11-15 03:34:00 +0000240 vendor: true,
Bao Dofbc99e02023-11-15 03:21:03 +0000241}
242
243prebuilt_etc {
Bao Dof6ce19d2024-07-04 11:07:02 +0800244 name: "aidl_default_audio_set_configurations_json",
Bao Dofbc99e02023-11-15 03:21:03 +0000245 src: "le_audio_configuration_set/audio_set_configurations.json",
Bao Dof6ce19d2024-07-04 11:07:02 +0800246 filename: "aidl_default_audio_set_configurations.json",
Bao Dofbc99e02023-11-15 03:21:03 +0000247 sub_dir: "aidl/le_audio",
Bao Dobe994192023-11-15 03:34:00 +0000248 vendor: true,
Bao Dofbc99e02023-11-15 03:21:03 +0000249}