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 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 137 | cc_library_shared { |
| 138 | name: "libaudioflinger", |
| 139 | |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 140 | defaults: [ |
| 141 | "latest_android_media_audio_common_types_cpp_shared", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 142 | "latest_android_hardware_audio_core_sounddose_ndk_shared", |
Andy Hung | f9829e4 | 2022-10-06 12:09:49 -0700 | [diff] [blame^] | 143 | "audioflinger_flags_defaults", |
Lorena Torres-Huerta | 03112f6 | 2022-08-12 23:08:12 +0000 | [diff] [blame] | 144 | ], |
| 145 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 146 | srcs: [ |
| 147 | "AudioFlinger.cpp", |
| 148 | "AudioHwDevice.cpp", |
| 149 | "AudioStreamOut.cpp", |
| 150 | "AudioWatchdog.cpp", |
| 151 | "BufLog.cpp", |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 152 | "DeviceEffectManager.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 153 | "Effects.cpp", |
| 154 | "FastCapture.cpp", |
| 155 | "FastCaptureDumpState.cpp", |
| 156 | "FastCaptureState.cpp", |
| 157 | "FastMixer.cpp", |
| 158 | "FastMixerDumpState.cpp", |
| 159 | "FastMixerState.cpp", |
| 160 | "FastThread.cpp", |
| 161 | "FastThreadDumpState.cpp", |
| 162 | "FastThreadState.cpp", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 163 | "MelReporter.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 164 | "NBAIO_Tee.cpp", |
Vlad Popa | 5161f8a | 2022-10-10 16:17:20 +0200 | [diff] [blame] | 165 | "PatchCommandThread.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 166 | "PatchPanel.cpp", |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 167 | "PropertyUtils.cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 168 | "SpdifStreamOut.cpp", |
| 169 | "StateQueue.cpp", |
| 170 | "Threads.cpp", |
| 171 | "Tracks.cpp", |
| 172 | "TypedLogger.cpp", |
| 173 | ], |
| 174 | |
| 175 | include_dirs: [ |
| 176 | "frameworks/av/services/audiopolicy", |
| 177 | "frameworks/av/services/medialog", |
| 178 | ], |
| 179 | |
| 180 | shared_libs: [ |
Jeongik Cha | 7f2285b | 2021-01-28 00:49:46 +0900 | [diff] [blame] | 181 | "audioflinger-aidl-cpp", |
| 182 | "audioclient-types-aidl-cpp", |
| 183 | "av-types-aidl-cpp", |
| 184 | "effect-aidl-cpp", |
Ytai Ben-Tsvi | 10dc0a6 | 2020-09-18 11:31:55 -0700 | [diff] [blame] | 185 | "libaudioclient_aidl_conversion", |
Andy Hung | 398ffa2 | 2022-12-13 19:19:53 -0800 | [diff] [blame] | 186 | "libaudioflinger_timing", |
jiabin | 4381040 | 2019-10-24 14:58:31 -0700 | [diff] [blame] | 187 | "libaudiofoundation", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 188 | "libaudiohal", |
| 189 | "libaudioprocessing", |
| 190 | "libaudiospdif", |
| 191 | "libaudioutils", |
| 192 | "libcutils", |
| 193 | "libutils", |
| 194 | "liblog", |
| 195 | "libbinder", |
Vlad Popa | 1d5f0d5 | 2022-12-18 12:21:26 +0100 | [diff] [blame] | 196 | "libbinder_ndk", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 197 | "libaudioclient", |
Vlad Popa | e8d9947 | 2022-06-30 16:02:48 +0200 | [diff] [blame] | 198 | "libaudiomanager", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 199 | "libmedialogservice", |
| 200 | "libmediametrics", |
| 201 | "libmediautils", |
| 202 | "libnbaio", |
| 203 | "libnblog", |
Steven Moreland | 30cc2ca | 2021-04-13 00:54:56 +0000 | [diff] [blame] | 204 | "libpermission", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 205 | "libpowermanager", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 206 | "libmemunreachable", |
| 207 | "libmedia_helper", |
Ytai Ben-Tsvi | 9cd8981 | 2020-07-01 17:12:06 -0700 | [diff] [blame] | 208 | "libshmemcompat", |
Vlad Popa | 2900c0a | 2022-10-24 13:38:00 +0200 | [diff] [blame] | 209 | "libsounddose", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 210 | "libvibrator", |
Samiul Islam | 3032bfb | 2021-08-26 11:41:21 +0100 | [diff] [blame] | 211 | "packagemanager_aidl-cpp", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 212 | ], |
| 213 | |
| 214 | static_libs: [ |
| 215 | "libcpustats", |
| 216 | "libsndfile", |
Svet Ganov | 3e5f14f | 2021-05-13 22:51:08 +0000 | [diff] [blame] | 217 | "libpermission", |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 218 | ], |
| 219 | |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 220 | header_libs: [ |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 221 | "libaaudio_headers", |
Ytai Ben-Tsvi | 7e7a79d | 2020-12-15 16:48:16 -0800 | [diff] [blame] | 222 | "libaudioclient_headers", |
Marco Nelissen | a51151a | 2020-01-07 13:37:47 -0800 | [diff] [blame] | 223 | "libaudiohal_headers", |
Vlad Popa | b042ee6 | 2022-10-20 18:05:00 +0200 | [diff] [blame] | 224 | "libaudioutils_headers", |
Jiabin Huang | bbb3823 | 2019-10-23 21:02:41 +0000 | [diff] [blame] | 225 | "libmedia_headers", |
| 226 | ], |
| 227 | |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 228 | export_shared_lib_headers: [ |
Steven Moreland | 30cc2ca | 2021-04-13 00:54:56 +0000 | [diff] [blame] | 229 | "libpermission", |
Vlad Popa | 03bd5bc | 2023-01-17 16:16:51 +0100 | [diff] [blame] | 230 | "android.hardware.audio.core.sounddose-V1-ndk", |
Philip P. Moltmann | bda4575 | 2020-07-17 16:41:18 -0700 | [diff] [blame] | 231 | ], |
| 232 | |
Anton Hansson | 0016740 | 2019-03-27 14:15:54 +0000 | [diff] [blame] | 233 | cflags: [ |
| 234 | "-DSTATE_QUEUE_INSTANTIATIONS=\"StateQueueInstantiations.cpp\"", |
| 235 | "-fvisibility=hidden", |
| 236 | "-Werror", |
| 237 | "-Wall", |
| 238 | ], |
| 239 | sanitize: { |
| 240 | integer_overflow: true, |
| 241 | }, |
| 242 | |
| 243 | } |
Akshata Kadam | 2668ffb | 2022-08-03 10:24:32 +0530 | [diff] [blame] | 244 | |
| 245 | cc_library_headers { |
| 246 | name: "libaudioflinger_headers", |
| 247 | export_include_dirs: ["."], |
| 248 | } |