1package { 2 // See: http://go/android-license-faq 3 // A large-scale-change added 'default_applicable_licenses' to import 4 // all of the 'license_kinds' from "frameworks_av_license" 5 // to get the below license kinds: 6 // SPDX-license-identifier-Apache-2.0 7 default_applicable_licenses: ["frameworks_av_license"], 8} 9 10tidy_errors = [ 11 // https://clang.llvm.org/extra/clang-tidy/checks/list.html 12 // For many categories, the checks are too many to specify individually. 13 // Feel free to disable as needed - as warnings are generally ignored, 14 // we treat warnings as errors. 15 "android-*", 16 "bugprone-*", 17 "cert-*", 18 "clang-analyzer-security*", 19 "google-*", 20 "misc-*", 21 //"modernize-*", // explicitly list the modernize as they can be subjective. 22 "modernize-avoid-bind", 23 //"modernize-avoid-c-arrays", // std::array<> can be verbose 24 "modernize-concat-nested-namespaces", 25 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. 26 "modernize-deprecated-ios-base-aliases", 27 "modernize-loop-convert", 28 "modernize-make-shared", 29 "modernize-make-unique", 30 "modernize-pass-by-value", 31 "modernize-raw-string-literal", 32 "modernize-redundant-void-arg", 33 "modernize-replace-auto-ptr", 34 "modernize-replace-random-shuffle", 35 "modernize-return-braced-init-list", 36 "modernize-shrink-to-fit", 37 "modernize-unary-static-assert", 38 // "modernize-use-auto", // found in AAudioAudio.cpp 39 "modernize-use-bool-literals", 40 "modernize-use-default-member-init", 41 "modernize-use-emplace", 42 "modernize-use-equals-default", 43 "modernize-use-equals-delete", 44 // "modernize-use-nodiscard", // found in aidl generated files 45 "modernize-use-noexcept", 46 "modernize-use-nullptr", 47 // "modernize-use-override", // found in aidl generated files 48 // "modernize-use-trailing-return-type", // not necessarily more readable 49 "modernize-use-transparent-functors", 50 "modernize-use-uncaught-exceptions", 51 // "modernize-use-using", // found typedef in several files 52 "performance-*", 53 54 // Remove some pedantic stylistic requirements. 55 "-android-cloexec-dup", // found in SharedMemoryParcelable.cpp 56 "-bugprone-macro-parentheses", // found in SharedMemoryParcelable.h 57 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t 58 59 "-google-readability-casting", // C++ casts not always necessary and may be verbose 60 "-google-readability-todo", // do not require TODO(info) 61 "-google-build-using-namespace", // Reenable and fix later. 62 "-google-global-names-in-headers", // found in several files 63 64 "-misc-non-private-member-variables-in-classes", // found in aidl generated files 65 66 "-performance-no-int-to-ptr", // found in SharedMemoryParcelable.h 67] 68 69cc_library { 70 name: "libaaudio", 71 72 local_include_dirs: [ 73 "binding", 74 "client", 75 "core", 76 "fifo", 77 "flowgraph", 78 "legacy", 79 "utility", 80 ], 81 header_libs: [ 82 "libaaudio_headers", 83 ], 84 export_header_lib_headers: ["libaaudio_headers"], 85 version_script: "libaaudio.map.txt", 86 87 srcs: [ 88 "core/AAudioAudio.cpp", 89 ], 90 91 cflags: [ 92 "-Wthread-safety", 93 "-Wno-unused-parameter", 94 "-Wall", 95 "-Werror", 96 // By default, all symbols are hidden. 97 // "-fvisibility=hidden", 98 // AAUDIO_API is used to explicitly export a function or a variable as a visible symbol. 99 "-DAAUDIO_API=__attribute__((visibility(\"default\")))", 100 ], 101 102 shared_libs: [ 103 "libaaudio_internal", 104 "libaudioclient", 105 "libaudioutils", 106 "libmedia_helper", 107 "libmediametrics", 108 "libmediautils", 109 "liblog", 110 "libcutils", 111 "libutils", 112 "libbinder", 113 "framework-permission-aidl-cpp", 114 ], 115 116 sanitize: { 117 integer_overflow: true, 118 misc_undefined: ["bounds"], 119 }, 120 121 stubs: { 122 symbol_file: "libaaudio.map.txt", 123 versions: ["28"], 124 }, 125 126 tidy: true, 127 tidy_checks: tidy_errors, 128 tidy_checks_as_errors: tidy_errors, 129 tidy_flags: [ 130 "-format-style=file", 131 ] 132} 133 134cc_library { 135 name: "libaaudio_internal", 136 137 local_include_dirs: [ 138 "binding", 139 "client", 140 "core", 141 "fifo", 142 "legacy", 143 "utility", 144 ], 145 146 export_include_dirs: ["."], 147 header_libs: [ 148 "libaaudio_headers", 149 "libmedia_headers", 150 "libmediametrics_headers", 151 ], 152 export_header_lib_headers: ["libaaudio_headers"], 153 154 export_shared_lib_headers: [ 155 "framework-permission-aidl-cpp", 156 ], 157 158 shared_libs: [ 159 "libaudioclient", 160 "libaudioutils", 161 "libmedia_helper", 162 "libmediametrics", 163 "libmediautils", 164 "liblog", 165 "libcutils", 166 "libutils", 167 "libbinder", 168 "framework-permission-aidl-cpp", 169 "aaudio-aidl-cpp", 170 "android.media.audio.common.types-V1-cpp", 171 "audioclient-types-aidl-cpp", 172 "libaudioclient_aidl_conversion", 173 ], 174 175 cflags: [ 176 "-Wno-unused-parameter", 177 "-Wall", 178 "-Werror", 179 ], 180 181 srcs: [ 182 "core/AudioGlobal.cpp", 183 "core/AudioStream.cpp", 184 "core/AudioStreamBuilder.cpp", 185 "core/AAudioStreamParameters.cpp", 186 "legacy/AudioStreamLegacy.cpp", 187 "legacy/AudioStreamRecord.cpp", 188 "legacy/AudioStreamTrack.cpp", 189 "utility/AAudioUtilities.cpp", 190 "utility/FixedBlockAdapter.cpp", 191 "utility/FixedBlockReader.cpp", 192 "utility/FixedBlockWriter.cpp", 193 "fifo/FifoBuffer.cpp", 194 "fifo/FifoControllerBase.cpp", 195 "client/AAudioFlowGraph.cpp", 196 "client/AudioEndpoint.cpp", 197 "client/AudioStreamInternal.cpp", 198 "client/AudioStreamInternalCapture.cpp", 199 "client/AudioStreamInternalPlay.cpp", 200 "client/IsochronousClockModel.cpp", 201 "binding/AudioEndpointParcelable.cpp", 202 "binding/AAudioBinderAdapter.cpp", 203 "binding/AAudioBinderClient.cpp", 204 "binding/AAudioStreamRequest.cpp", 205 "binding/AAudioStreamConfiguration.cpp", 206 "binding/RingBufferParcelable.cpp", 207 "binding/SharedMemoryParcelable.cpp", 208 "binding/SharedRegionParcelable.cpp", 209 "flowgraph/ChannelCountConverter.cpp", 210 "flowgraph/ClipToRange.cpp", 211 "flowgraph/FlowGraphNode.cpp", 212 "flowgraph/ManyToMultiConverter.cpp", 213 "flowgraph/MonoBlend.cpp", 214 "flowgraph/MonoToMultiConverter.cpp", 215 "flowgraph/MultiToMonoConverter.cpp", 216 "flowgraph/MultiToManyConverter.cpp", 217 "flowgraph/RampLinear.cpp", 218 "flowgraph/SampleRateConverter.cpp", 219 "flowgraph/SinkFloat.cpp", 220 "flowgraph/SinkI16.cpp", 221 "flowgraph/SinkI24.cpp", 222 "flowgraph/SinkI32.cpp", 223 "flowgraph/SourceFloat.cpp", 224 "flowgraph/SourceI16.cpp", 225 "flowgraph/SourceI24.cpp", 226 "flowgraph/SourceI32.cpp", 227 "flowgraph/resampler/IntegerRatio.cpp", 228 "flowgraph/resampler/LinearResampler.cpp", 229 "flowgraph/resampler/MultiChannelResampler.cpp", 230 "flowgraph/resampler/PolyphaseResampler.cpp", 231 "flowgraph/resampler/PolyphaseResamplerMono.cpp", 232 "flowgraph/resampler/PolyphaseResamplerStereo.cpp", 233 "flowgraph/resampler/SincResampler.cpp", 234 "flowgraph/resampler/SincResamplerStereo.cpp", 235 ], 236 sanitize: { 237 integer_overflow: true, 238 misc_undefined: ["bounds"], 239 }, 240 241 tidy: true, 242 tidy_checks: tidy_errors, 243 tidy_checks_as_errors: tidy_errors, 244 tidy_flags: [ 245 "-format-style=file", 246 ] 247} 248 249aidl_interface { 250 name: "aaudio-aidl", 251 unstable: true, 252 local_include_dir: "binding/aidl", 253 srcs: [ 254 "binding/aidl/aaudio/Endpoint.aidl", 255 "binding/aidl/aaudio/RingBuffer.aidl", 256 "binding/aidl/aaudio/SharedRegion.aidl", 257 "binding/aidl/aaudio/StreamParameters.aidl", 258 "binding/aidl/aaudio/StreamRequest.aidl", 259 "binding/aidl/aaudio/IAAudioClient.aidl", 260 "binding/aidl/aaudio/IAAudioService.aidl", 261 ], 262 imports: [ 263 "android.media.audio.common.types-V1", 264 "audioclient-types-aidl", 265 "shared-file-region-aidl", 266 "framework-permission-aidl", 267 ], 268 backend: 269 { 270 java: { 271 sdk_version: "module_current", 272 }, 273 }, 274} 275