1/*
2 * Copyright (C) 2021 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 */
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "system_bt_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["system_bt_license"],
24}
25
26cc_defaults {
27    name: "libbt_audio_hal_interface_fuzz_defaults",
28    header_libs: [
29        "avrcp_headers",
30        "libbluetooth_headers",
31    ],
32    defaults: [
33        "latest_android_hardware_audio_common_ndk_static",
34        "latest_android_hardware_bluetooth_audio_ndk_static",
35        "latest_android_media_audio_common_types_ndk_static",
36    ],
37    shared_libs: [
38        "libPlatformProperties",
39        "libaaudio",
40        "libaconfig_storage_read_api_cc",
41        "libbinder_ndk",
42        "libcrypto",
43        "libfmq",
44        "libstatslog",
45        "libstatssocket",
46        "libz",
47        "server_configurable_flags",
48    ],
49    static_libs: [
50        "android.hardware.audio.common@5.0",
51        "android.hardware.bluetooth.a2dp@1.0",
52        "android.hardware.bluetooth.audio@2.0",
53        "android.hardware.bluetooth.audio@2.1",
54        "android.hardware.bluetooth@1.0",
55        "android.hardware.bluetooth@1.1",
56        "android.hardware.common-V2-ndk",
57        "android.hardware.common.fmq-V1-ndk",
58        "android.system.suspend-V1-ndk",
59        "android.system.suspend.control-V1-ndk",
60        "libFraunhoferAAC",
61        "libaudio-a2dp-hw-utils",
62        "libbase",
63        "libbluetooth-dumpsys",
64        "libbluetooth-gdx",
65        "libbluetooth-protos",
66        "libbluetooth-types",
67        "libbluetooth_core_rs",
68        "libbluetooth_crypto_toolbox",
69        "libbluetooth_gd",
70        "libbluetooth_log",
71        "libbluetooth_rust_interop",
72        "libbt-audio-hal-interface",
73        "libbt-bta",
74        "libbt-bta-core",
75        "libbt-btu-main-thread",
76        "libbt-common",
77        "libbt-hci",
78        "libbt-jni-thread",
79        "libbt-sbc-decoder",
80        "libbt-sbc-encoder",
81        "libbt-stack",
82        "libbt-stack-core",
83        "libbt_shim_bridge",
84        "libbtcore",
85        "libbtdevice",
86        "libbte",
87        "libbtif",
88        "libbtif-core",
89        "libcgrouprc",
90        "libcgrouprc_format",
91        "libchrome",
92        "libcutils",
93        "libevent",
94        "libg722codec",
95        "libhidlbase",
96        "libjsoncpp",
97        "liblc3",
98        "liblog",
99        "libopus",
100        "libosi",
101        "libprotobuf-cpp-lite",
102        "libstatslog_bt",
103        "libudrv-uipc",
104        "libutils",
105        "libvndksupport",
106    ],
107    include_dirs: [
108        "packages/modules/Bluetooth/system",
109        "packages/modules/Bluetooth/system/bta/include",
110        "packages/modules/Bluetooth/system/btif",
111        "packages/modules/Bluetooth/system/gd",
112        "packages/modules/Bluetooth/system/stack/include",
113    ],
114    fuzz_config: {
115        cc: ["android-bluetooth-security@google.com"],
116        componentid: 27441,
117        hotlists: [
118            "4593311",
119        ],
120        description: "The fuzzer targets the APIs of libbt-audio-hal-interface",
121        vector: "local_no_privileges_required",
122        service_privilege: "privileged",
123        users: "multi_user",
124        fuzzed_code_usage: "shipped",
125    },
126}
127
128cc_fuzz {
129    name: "libbt_audio_hal_a2dp_encoding_fuzzer",
130    defaults: [
131        "libbt_audio_hal_interface_fuzz_defaults",
132    ],
133    srcs: [
134        "libbt_audio_hal_a2dp_encoding_fuzzer.cpp",
135    ],
136}
137
138cc_fuzz {
139    name: "libbt_audio_hal_le_audio_software_fuzzer",
140    defaults: [
141        "libbt_audio_hal_interface_fuzz_defaults",
142    ],
143    srcs: [
144        "libbt_audio_hal_le_audio_software_fuzzer.cpp",
145    ],
146}
147
148cc_fuzz {
149    name: "libbt_audio_hal_hearing_aid_software_encoding_fuzzer",
150    defaults: [
151        "libbt_audio_hal_interface_fuzz_defaults",
152    ],
153    srcs: [
154        "libbt_audio_hal_hearing_aid_software_encoding_fuzzer.cpp",
155    ],
156    static_libs: [
157        "libbinder_random_parcel",
158    ],
159    shared_libs: [
160        "libbinder",
161    ],
162}
163
164cc_fuzz {
165    name: "libbt_audio_hal_client_interface_fuzzer",
166    defaults: [
167        "libbt_audio_hal_interface_fuzz_defaults",
168    ],
169    srcs: [
170        "libbt_audio_hal_client_interface_fuzzer.cpp",
171    ],
172}
173