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 | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 22 | tidy_errors = [ |
| 23 | // https://clang.llvm.org/extra/clang-tidy/checks/list.html |
| 24 | // For many categories, the checks are too many to specify individually. |
| 25 | // Feel free to disable as needed - as warnings are generally ignored, |
| 26 | // we treat warnings as errors. |
| 27 | "android-*", |
| 28 | "bugprone-*", |
| 29 | "cert-*", |
| 30 | "clang-analyzer-security*", |
| 31 | "google-*", |
| 32 | "misc-*", |
| 33 | //"modernize-*", // explicitly list the modernize as they can be subjective. |
| 34 | "modernize-avoid-bind", |
| 35 | //"modernize-avoid-c-arrays", // std::array<> can be verbose |
| 36 | "modernize-concat-nested-namespaces", |
| 37 | //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. |
| 38 | "modernize-deprecated-ios-base-aliases", |
| 39 | "modernize-loop-convert", |
| 40 | "modernize-make-shared", |
| 41 | "modernize-make-unique", |
| 42 | // "modernize-pass-by-value", |
| 43 | "modernize-raw-string-literal", |
| 44 | "modernize-redundant-void-arg", |
| 45 | "modernize-replace-auto-ptr", |
| 46 | "modernize-replace-random-shuffle", |
| 47 | "modernize-return-braced-init-list", |
| 48 | "modernize-shrink-to-fit", |
| 49 | "modernize-unary-static-assert", |
| 50 | // "modernize-use-auto", // found in MediaMetricsService.h, debatable - auto can obscure type |
| 51 | "modernize-use-bool-literals", |
| 52 | "modernize-use-default-member-init", |
| 53 | "modernize-use-emplace", |
| 54 | "modernize-use-equals-default", |
| 55 | "modernize-use-equals-delete", |
| 56 | // "modernize-use-nodiscard", |
| 57 | "modernize-use-noexcept", |
| 58 | "modernize-use-nullptr", |
| 59 | "modernize-use-override", |
| 60 | //"modernize-use-trailing-return-type", // not necessarily more readable |
| 61 | "modernize-use-transparent-functors", |
| 62 | "modernize-use-uncaught-exceptions", |
| 63 | "modernize-use-using", |
| 64 | "performance-*", |
| 65 | |
| 66 | // Remove some pedantic stylistic requirements. |
| 67 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
| 68 | "-google-readability-todo", // do not require TODO(info) |
| 69 | |
| 70 | "-bugprone-unhandled-self-assignment", |
| 71 | "-bugprone-suspicious-string-compare", |
| 72 | "-cert-oop54-cpp", // found in TransactionLog.h |
| 73 | "-bugprone-narrowing-conversions", // b/182410845 |
| 74 | |
| 75 | // TODO(b/275642749) Reenable these warnings |
| 76 | "-bugprone-assignment-in-if-condition", |
| 77 | "-bugprone-forward-declaration-namespace", |
| 78 | "-bugprone-parent-virtual-call", |
| 79 | "-cert-dcl59-cpp", |
| 80 | "-cert-err34-c", |
| 81 | "-google-build-namespaces", |
| 82 | "-google-build-using-namespace", |
| 83 | "-google-default-arguments", |
| 84 | "-google-runtime-int", |
| 85 | "-misc-const-correctness", |
| 86 | "-misc-non-private-member-variables-in-classes", |
| 87 | "-modernize-concat-nested-namespaces", |
| 88 | "-modernize-loop-convert", |
| 89 | "-modernize-use-default-member-init", |
| 90 | "-modernize-use-equals-default", |
| 91 | "-modernize-use-nullptr", |
| 92 | "-modernize-use-override", |
| 93 | "-modernize-use-using", |
| 94 | "-performance-no-int-to-ptr", |
| 95 | ] |
| 96 | |
| 97 | // Eventually use common tidy defaults |
| 98 | cc_defaults { |
| 99 | name: "audioflinger_flags_defaults", |
| 100 | // https://clang.llvm.org/docs/UsersManual.html#command-line-options |
| 101 | // https://clang.llvm.org/docs/DiagnosticsReference.html |
| 102 | cflags: [ |
| 103 | "-Wall", |
| 104 | "-Wdeprecated", |
| 105 | "-Werror", |
| 106 | "-Werror=implicit-fallthrough", |
| 107 | "-Werror=sometimes-uninitialized", |
| 108 | "-Werror=conditional-uninitialized", |
| 109 | "-Wextra", |
| 110 | |
| 111 | // suppress some warning chatter. |
| 112 | "-Wno-deprecated-copy-with-dtor", |
| 113 | "-Wno-deprecated-copy-with-user-provided-dtor", |
| 114 | |
| 115 | "-Wredundant-decls", |
| 116 | "-Wshadow", |
| 117 | "-Wstrict-aliasing", |
| 118 | "-fstrict-aliasing", |
| 119 | "-Wthread-safety", |
| 120 | //"-Wthread-safety-negative", // experimental - looks broken in R. |
| 121 | "-Wunreachable-code", |
| 122 | "-Wunreachable-code-break", |
| 123 | "-Wunreachable-code-return", |
| 124 | "-Wunused", |
| 125 | "-Wused-but-marked-unused", |
| 126 | "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS", |
| 127 | ], |
| 128 | // https://clang.llvm.org/extra/clang-tidy/ |
| 129 | tidy: true, |
| 130 | tidy_checks: tidy_errors, |
| 131 | tidy_checks_as_errors: tidy_errors, |
| 132 | tidy_flags: [ |
| 133 | "-format-style=file", |
| 134 | ], |
| 135 | } |
| 136 | |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame^] | 137 | cc_defaults { |
| 138 | name: "libaudioflinger_dependencies", |
| 139 | |
| 140 | shared_libs: [ |
| 141 | "audioflinger-aidl-cpp", |
| 142 | "audioclient-types-aidl-cpp", |
| 143 | "av-types-aidl-cpp", |
| 144 | "effect-aidl-cpp", |
| 145 | "libaudioclient_aidl_conversion", |
| 146 | "libactivitymanager_aidl", |
| 147 | "libaudioflinger_timing", |
| 148 | "libaudiofoundation", |
| 149 | "libaudiohal", |
| 150 | "libaudioprocessing", |
| 151 | "libaudioutils", |
| 152 | "libcutils", |
| 153 | "libutils", |
| 154 | "liblog", |
| 155 | "libbinder", |
| 156 | "libbinder_ndk", |
| 157 | "libaudioclient", |
| 158 | "libaudiomanager", |
| 159 | "libmediametrics", |
| 160 | "libmediautils", |
| 161 | "libnblog", |
| 162 | "libpermission", |
| 163 | "libpowermanager", |
| 164 | "libmemunreachable", |
| 165 | "libmedia_helper", |
| 166 | "libshmemcompat", |
| 167 | "libsounddose", |
| 168 | "libvibrator", |
| 169 | "packagemanager_aidl-cpp", |
| 170 | ], |
| 171 | |
| 172 | static_libs: [ |
| 173 | "libmedialogservice", |
| 174 | "libaudiospdif", |
| 175 | "libnbaio", |
| 176 | ], |
| 177 | } |
| 178 | |
| 179 | |
| 180 | cc_library { |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 181 | name: "libaudioflinger", |
| 182 | |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 183 | defaults: [ |
Devin Moore | 55a2fc9 | 2023-05-11 23:48:00 +0000 | [diff] [blame^] | 184 | "libaudioflinger_dependencies", |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 185 | "latest_android_media_audio_common_types_cpp_shared", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 186 | "latest_android_hardware_audio_core_sounddose_ndk_shared", |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame] | 187 | "audioflinger_flags_defaults", |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 188 | ], |
| 189 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 190 | srcs: [ |
| 191 | "AudioFlinger.cpp", |
| 192 | "AudioHwDevice.cpp", |
| 193 | "AudioStreamOut.cpp", |
| 194 | "AudioWatchdog.cpp", |
| 195 | "BufLog.cpp", |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 196 | "DeviceEffectManager.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 197 | "Effects.cpp", |
| 198 | "FastCapture.cpp", |
| 199 | "FastCaptureDumpState.cpp", |
| 200 | "FastCaptureState.cpp", |
| 201 | "FastMixer.cpp", |
| 202 | "FastMixerDumpState.cpp", |
| 203 | "FastMixerState.cpp", |
| 204 | "FastThread.cpp", |
| 205 | "FastThreadDumpState.cpp", |
| 206 | "FastThreadState.cpp", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 207 | "MelReporter.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 208 | "NBAIO_Tee.cpp", |
Vlad Popa | 5161f8a | 2022-10-10 16:17:20 +0200 | [diff] [blame] | 209 | "PatchCommandThread.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 210 | "PatchPanel.cpp", |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 211 | "PropertyUtils.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 212 | "SpdifStreamOut.cpp", |
| 213 | "StateQueue.cpp", |
| 214 | "Threads.cpp", |
| 215 | "Tracks.cpp", |
| 216 | "TypedLogger.cpp", |
| 217 | ], |
| 218 | |
| 219 | include_dirs: [ |
| 220 | "frameworks/av/services/audiopolicy", |
| 221 | "frameworks/av/services/medialog", |
| 222 | ], |
| 223 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 224 | static_libs: [ |
| 225 | "libcpustats", |
| 226 | "libsndfile", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 227 | "libpermission", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 228 | ], |
| 229 | |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 230 | header_libs: [ |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 231 | "libaaudio_headers", |
Ytai Ben-Tsvi | 7e7a79d | 2020-12-15 16:48:16 -0800 | [diff] [blame] | 232 | "libaudioclient_headers", |
Marco Nelissen | a51151a | 2020-01-07 13:37:47 -0800 | [diff] [blame] | 233 | "libaudiohal_headers", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 234 | "libaudioutils_headers", |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 235 | "libmedia_headers", |
| 236 | ], |
| 237 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 238 | export_shared_lib_headers: [ |
Steven Moreland | 30cc2ca | 2021-04-13 00:54:56 +0000 | [diff] [blame] | 239 | "libpermission", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 240 | "android.hardware.audio.core.sounddose-V1-ndk", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 241 | ], |
| 242 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 243 | cflags: [ |
| 244 | "-DSTATE_QUEUE_INSTANTIATIONS=\"StateQueueInstantiations.cpp\"", |
| 245 | "-fvisibility=hidden", |
| 246 | "-Werror", |
| 247 | "-Wall", |
| 248 | ], |
| 249 | sanitize: { |
| 250 | integer_overflow: true, |
| 251 | }, |
| 252 | |
| 253 | } |
Akshata Kadam | 2668ffb | 2022-08-03 10:24:32 +0530 | [diff] [blame] | 254 | |
| 255 | cc_library_headers { |
| 256 | name: "libaudioflinger_headers", |
| 257 | export_include_dirs: ["."], |
| 258 | } |