Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 1 | |
| 2 | |
Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 3 | package { |
| 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 |
| 11 | license { |
| 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 Hung | af97c61 | 2023-06-12 15:04:00 -0700 | [diff] [blame] | 22 | // base tidy_errors for this and all subprojects. |
| 23 | audioflinger_base_tidy_errors = [ |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 24 | // 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 Hung | af97c61 | 2023-06-12 15:04:00 -0700 | [diff] [blame] | 75 | ] |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 76 | |
Andy Hung | af97c61 | 2023-06-12 15:04:00 -0700 | [diff] [blame] | 77 | // TODO(b/275642749) Reenable these warnings |
| 78 | audioflinger_tidy_errors = audioflinger_base_tidy_errors + [ |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 79 | "-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 Hung | 7bac54f | 2023-06-12 16:56:30 -0700 | [diff] [blame] | 100 | audioflinger_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 Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 126 | // Eventually use common tidy defaults |
| 127 | cc_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 Hung | 7bac54f | 2023-06-12 16:56:30 -0700 | [diff] [blame] | 131 | cflags: audioflinger_base_cflags, |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 132 | // https://clang.llvm.org/extra/clang-tidy/ |
| 133 | tidy: true, |
Andy Hung | af97c61 | 2023-06-12 15:04:00 -0700 | [diff] [blame] | 134 | tidy_checks: audioflinger_tidy_errors, |
| 135 | tidy_checks_as_errors: audioflinger_tidy_errors, |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 136 | tidy_flags: [ |
| 137 | "-format-style=file", |
| 138 | ], |
| 139 | } |
| 140 | |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 141 | cc_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 Hung | 76913a0 | 2023-06-15 14:50:18 -0700 | [diff] [blame] | 151 | "libaudioflinger_datapath", |
Andy Hung | 66cb382 | 2023-05-23 17:36:46 -0700 | [diff] [blame] | 152 | "libaudioflinger_fastpath", |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 153 | "libaudioflinger_timing", |
Andy Hung | 2c20bd8 | 2023-05-24 11:53:47 -0700 | [diff] [blame] | 154 | "libaudioflinger_utils", |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 155 | "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 Hung | 2c20bd8 | 2023-05-24 11:53:47 -0700 | [diff] [blame] | 168 | "libnbaio", |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 169 | "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 Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 183 | ], |
| 184 | } |
| 185 | |
| 186 | |
| 187 | cc_library { |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 188 | name: "libaudioflinger", |
| 189 | |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 190 | defaults: [ |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame] | 191 | "libaudioflinger_dependencies", |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 192 | "latest_android_media_audio_common_types_cpp_shared", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 193 | "latest_android_hardware_audio_core_sounddose_ndk_shared", |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 194 | "audioflinger_flags_defaults", |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 195 | ], |
| 196 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 197 | srcs: [ |
| 198 | "AudioFlinger.cpp", |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 199 | "DeviceEffectManager.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 200 | "Effects.cpp", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 201 | "MelReporter.cpp", |
Vlad Popa | 5161f8a | 2022-10-10 16:17:20 +0200 | [diff] [blame] | 202 | "PatchCommandThread.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 203 | "PatchPanel.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 204 | "Threads.cpp", |
| 205 | "Tracks.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 206 | ], |
| 207 | |
| 208 | include_dirs: [ |
| 209 | "frameworks/av/services/audiopolicy", |
| 210 | "frameworks/av/services/medialog", |
| 211 | ], |
| 212 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 213 | static_libs: [ |
| 214 | "libcpustats", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 215 | "libpermission", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 216 | ], |
| 217 | |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 218 | header_libs: [ |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 219 | "libaaudio_headers", |
Ytai Ben-Tsvi | 7e7a79d | 2020-12-15 16:48:16 -0800 | [diff] [blame] | 220 | "libaudioclient_headers", |
Marco Nelissen | a51151a | 2020-01-07 13:37:47 -0800 | [diff] [blame] | 221 | "libaudiohal_headers", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 222 | "libaudioutils_headers", |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 223 | "libmedia_headers", |
| 224 | ], |
| 225 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 226 | export_shared_lib_headers: [ |
Steven Moreland | 30cc2ca | 2021-04-13 00:54:56 +0000 | [diff] [blame] | 227 | "libpermission", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 228 | "android.hardware.audio.core.sounddose-V1-ndk", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 229 | ], |
| 230 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 231 | cflags: [ |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 232 | "-fvisibility=hidden", |
| 233 | "-Werror", |
| 234 | "-Wall", |
| 235 | ], |
| 236 | sanitize: { |
| 237 | integer_overflow: true, |
| 238 | }, |
| 239 | |
| 240 | } |
Akshata Kadam | 2668ffb | 2022-08-03 10:24:32 +0530 | [diff] [blame] | 241 | |
| 242 | cc_library_headers { |
| 243 | name: "libaudioflinger_headers", |
| 244 | export_include_dirs: ["."], |
| 245 | } |