blob: 76632501c7c81263f133637f272be36d32236fd9 [file] [log] [blame]
Anton Hansson00167402019-03-27 14:15:54 +00001
2
Bob Badour56786ac2021-02-25 15:24:36 -08003package {
4 default_applicable_licenses: [
5 "frameworks_av_services_audioflinger_license",
6 ],
7}
8
9// Added automatically by a large-scale-change
10// See: http://go/android-license-faq
11license {
12 name: "frameworks_av_services_audioflinger_license",
13 visibility: [":__subpackages__"],
14 license_kinds: [
15 "SPDX-license-identifier-Apache-2.0",
16 ],
17 license_text: [
18 "NOTICE",
19 ],
20}
21
Andy Hungaf97c612023-06-12 15:04:00 -070022// base tidy_errors for this and all subprojects.
23audioflinger_base_tidy_errors = [
Andy Hungf9829e42022-10-06 12:09:49 -070024 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
25 // For many categories, the checks are too many to specify individually.
26 // Feel free to disable as needed - as warnings are generally ignored,
27 // we treat warnings as errors.
28 "android-*",
29 "bugprone-*",
30 "cert-*",
31 "clang-analyzer-security*",
32 "google-*",
33 "misc-*",
34 //"modernize-*", // explicitly list the modernize as they can be subjective.
35 "modernize-avoid-bind",
36 //"modernize-avoid-c-arrays", // std::array<> can be verbose
37 "modernize-concat-nested-namespaces",
38 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
39 "modernize-deprecated-ios-base-aliases",
40 "modernize-loop-convert",
41 "modernize-make-shared",
42 "modernize-make-unique",
43 // "modernize-pass-by-value",
44 "modernize-raw-string-literal",
45 "modernize-redundant-void-arg",
46 "modernize-replace-auto-ptr",
47 "modernize-replace-random-shuffle",
48 "modernize-return-braced-init-list",
49 "modernize-shrink-to-fit",
50 "modernize-unary-static-assert",
51 // "modernize-use-auto", // found in MediaMetricsService.h, debatable - auto can obscure type
52 "modernize-use-bool-literals",
53 "modernize-use-default-member-init",
54 "modernize-use-emplace",
55 "modernize-use-equals-default",
56 "modernize-use-equals-delete",
57 // "modernize-use-nodiscard",
58 "modernize-use-noexcept",
59 "modernize-use-nullptr",
60 "modernize-use-override",
61 //"modernize-use-trailing-return-type", // not necessarily more readable
62 "modernize-use-transparent-functors",
63 "modernize-use-uncaught-exceptions",
64 "modernize-use-using",
65 "performance-*",
66
67 // Remove some pedantic stylistic requirements.
68 "-google-readability-casting", // C++ casts not always necessary and may be verbose
69 "-google-readability-todo", // do not require TODO(info)
70
71 "-bugprone-unhandled-self-assignment",
72 "-bugprone-suspicious-string-compare",
73 "-cert-oop54-cpp", // found in TransactionLog.h
74 "-bugprone-narrowing-conversions", // b/182410845
Andy Hungaf97c612023-06-12 15:04:00 -070075]
Andy Hungf9829e42022-10-06 12:09:49 -070076
Andy Hungaf97c612023-06-12 15:04:00 -070077// TODO(b/275642749) Reenable these warnings
78audioflinger_tidy_errors = audioflinger_base_tidy_errors + [
Andy Hungf9829e42022-10-06 12:09:49 -070079 "-bugprone-assignment-in-if-condition",
80 "-bugprone-forward-declaration-namespace",
81 "-bugprone-parent-virtual-call",
82 "-cert-dcl59-cpp",
83 "-cert-err34-c",
84 "-google-build-namespaces",
85 "-google-build-using-namespace",
86 "-google-default-arguments",
87 "-google-runtime-int",
88 "-misc-const-correctness",
89 "-misc-non-private-member-variables-in-classes",
90 "-modernize-concat-nested-namespaces",
91 "-modernize-loop-convert",
92 "-modernize-use-default-member-init",
93 "-modernize-use-equals-default",
94 "-modernize-use-nullptr",
95 "-modernize-use-override",
96 "-modernize-use-using",
97 "-performance-no-int-to-ptr",
98]
99
Andy Hung7bac54f2023-06-12 16:56:30 -0700100audioflinger_base_cflags = [
101 "-Wall",
102 "-Wdeprecated",
103 "-Werror",
104 "-Werror=implicit-fallthrough",
105 "-Werror=sometimes-uninitialized",
106 "-Werror=conditional-uninitialized",
107 "-Wextra",
108
109 // suppress some warning chatter.
110 "-Wno-deprecated-copy-with-dtor",
111 "-Wno-deprecated-copy-with-user-provided-dtor",
112
113 "-Wredundant-decls",
114 "-Wshadow",
115 "-Wstrict-aliasing",
116 "-fstrict-aliasing",
117 "-Wthread-safety",
118 //"-Wthread-safety-negative", // experimental - looks broken in R.
119 "-Wunreachable-code",
120 "-Wunreachable-code-break",
121 "-Wunreachable-code-return",
122 "-Wunused",
123 "-Wused-but-marked-unused",
124]
125
Andy Hungf9829e42022-10-06 12:09:49 -0700126// Eventually use common tidy defaults
127cc_defaults {
128 name: "audioflinger_flags_defaults",
129 // https://clang.llvm.org/docs/UsersManual.html#command-line-options
130 // https://clang.llvm.org/docs/DiagnosticsReference.html
Andy Hung7bac54f2023-06-12 16:56:30 -0700131 cflags: audioflinger_base_cflags,
Andy Hungf9829e42022-10-06 12:09:49 -0700132 // https://clang.llvm.org/extra/clang-tidy/
133 tidy: true,
Andy Hungaf97c612023-06-12 15:04:00 -0700134 tidy_checks: audioflinger_tidy_errors,
135 tidy_checks_as_errors: audioflinger_tidy_errors,
Andy Hungf9829e42022-10-06 12:09:49 -0700136 tidy_flags: [
137 "-format-style=file",
138 ],
139}
140
Devin Moore55a2fc92023-05-11 23:48:00 +0000141cc_defaults {
142 name: "libaudioflinger_dependencies",
143
144 shared_libs: [
145 "audioflinger-aidl-cpp",
146 "audioclient-types-aidl-cpp",
147 "av-types-aidl-cpp",
148 "effect-aidl-cpp",
149 "libaudioclient_aidl_conversion",
150 "libactivitymanager_aidl",
Andy Hung76913a02023-06-15 14:50:18 -0700151 "libaudioflinger_datapath",
Andy Hung66cb3822023-05-23 17:36:46 -0700152 "libaudioflinger_fastpath",
Devin Moore55a2fc92023-05-11 23:48:00 +0000153 "libaudioflinger_timing",
Andy Hung2c20bd82023-05-24 11:53:47 -0700154 "libaudioflinger_utils",
Devin Moore55a2fc92023-05-11 23:48:00 +0000155 "libaudiofoundation",
156 "libaudiohal",
157 "libaudioprocessing",
158 "libaudioutils",
159 "libcutils",
160 "libutils",
161 "liblog",
162 "libbinder",
163 "libbinder_ndk",
164 "libaudioclient",
165 "libaudiomanager",
166 "libmediametrics",
167 "libmediautils",
Andy Hung2c20bd82023-05-24 11:53:47 -0700168 "libnbaio",
Devin Moore55a2fc92023-05-11 23:48:00 +0000169 "libnblog",
170 "libpermission",
171 "libpowermanager",
172 "libmemunreachable",
173 "libmedia_helper",
174 "libshmemcompat",
175 "libsounddose",
176 "libvibrator",
177 "packagemanager_aidl-cpp",
178 ],
179
180 static_libs: [
181 "libmedialogservice",
182 "libaudiospdif",
Devin Moore55a2fc92023-05-11 23:48:00 +0000183 ],
184}
185
186
187cc_library {
Anton Hansson00167402019-03-27 14:15:54 +0000188 name: "libaudioflinger",
189
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000190 defaults: [
Devin Moore55a2fc92023-05-11 23:48:00 +0000191 "libaudioflinger_dependencies",
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000192 "latest_android_media_audio_common_types_cpp_shared",
Vlad Popa03bd5bc2023-01-17 16:16:51 +0100193 "latest_android_hardware_audio_core_sounddose_ndk_shared",
Andy Hungf9829e42022-10-06 12:09:49 -0700194 "audioflinger_flags_defaults",
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000195 ],
196
Anton Hansson00167402019-03-27 14:15:54 +0000197 srcs: [
198 "AudioFlinger.cpp",
Andy Hungf52264b2023-07-18 17:32:15 -0700199 "Client.cpp",
Eric Laurentb82e6b72019-11-22 17:25:04 -0800200 "DeviceEffectManager.cpp",
Anton Hansson00167402019-03-27 14:15:54 +0000201 "Effects.cpp",
Vlad Popab042ee62022-10-20 18:05:00 +0200202 "MelReporter.cpp",
Vlad Popa5161f8a2022-10-10 16:17:20 +0200203 "PatchCommandThread.cpp",
Anton Hansson00167402019-03-27 14:15:54 +0000204 "PatchPanel.cpp",
Anton Hansson00167402019-03-27 14:15:54 +0000205 "Threads.cpp",
206 "Tracks.cpp",
Anton Hansson00167402019-03-27 14:15:54 +0000207 ],
208
209 include_dirs: [
210 "frameworks/av/services/audiopolicy",
211 "frameworks/av/services/medialog",
212 ],
213
Anton Hansson00167402019-03-27 14:15:54 +0000214 static_libs: [
215 "libcpustats",
Svet Ganov3e5f14f2021-05-13 22:51:08 +0000216 "libpermission",
Anton Hansson00167402019-03-27 14:15:54 +0000217 ],
218
Jiabin Huangbbb38232019-10-23 21:02:41 +0000219 header_libs: [
Jiabin Huangebe64102021-09-07 20:01:07 +0000220 "libaaudio_headers",
Ytai Ben-Tsvi7e7a79d2020-12-15 16:48:16 -0800221 "libaudioclient_headers",
Marco Nelissena51151a2020-01-07 13:37:47 -0800222 "libaudiohal_headers",
Vlad Popab042ee62022-10-20 18:05:00 +0200223 "libaudioutils_headers",
Jiabin Huangbbb38232019-10-23 21:02:41 +0000224 "libmedia_headers",
225 ],
226
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700227 export_shared_lib_headers: [
Steven Moreland30cc2ca2021-04-13 00:54:56 +0000228 "libpermission",
Vlad Popa03bd5bc2023-01-17 16:16:51 +0100229 "android.hardware.audio.core.sounddose-V1-ndk",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700230 ],
231
Anton Hansson00167402019-03-27 14:15:54 +0000232 cflags: [
Anton Hansson00167402019-03-27 14:15:54 +0000233 "-fvisibility=hidden",
234 "-Werror",
235 "-Wall",
236 ],
237 sanitize: {
238 integer_overflow: true,
239 },
240
241}
Akshata Kadam2668ffb2022-08-03 10:24:32 +0530242
243cc_library_headers {
244 name: "libaudioflinger_headers",
245 export_include_dirs: ["."],
246}