package { default_applicable_licenses: [ "frameworks_av_services_audioflinger_license", ], } // Added automatically by a large-scale-change // See: http://go/android-license-faq license { name: "frameworks_av_services_audioflinger_license", visibility: [":__subpackages__"], license_kinds: [ "SPDX-license-identifier-Apache-2.0", ], license_text: [ "NOTICE", ], } tidy_errors = [ // https://clang.llvm.org/extra/clang-tidy/checks/list.html // For many categories, the checks are too many to specify individually. // Feel free to disable as needed - as warnings are generally ignored, // we treat warnings as errors. "android-*", "bugprone-*", "cert-*", "clang-analyzer-security*", "google-*", "misc-*", //"modernize-*", // explicitly list the modernize as they can be subjective. "modernize-avoid-bind", //"modernize-avoid-c-arrays", // std::array<> can be verbose "modernize-concat-nested-namespaces", //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. "modernize-deprecated-ios-base-aliases", "modernize-loop-convert", "modernize-make-shared", "modernize-make-unique", // "modernize-pass-by-value", "modernize-raw-string-literal", "modernize-redundant-void-arg", "modernize-replace-auto-ptr", "modernize-replace-random-shuffle", "modernize-return-braced-init-list", "modernize-shrink-to-fit", "modernize-unary-static-assert", // "modernize-use-auto", // found in MediaMetricsService.h, debatable - auto can obscure type "modernize-use-bool-literals", "modernize-use-default-member-init", "modernize-use-emplace", "modernize-use-equals-default", "modernize-use-equals-delete", // "modernize-use-nodiscard", "modernize-use-noexcept", "modernize-use-nullptr", "modernize-use-override", //"modernize-use-trailing-return-type", // not necessarily more readable "modernize-use-transparent-functors", "modernize-use-uncaught-exceptions", "modernize-use-using", "performance-*", // Remove some pedantic stylistic requirements. "-google-readability-casting", // C++ casts not always necessary and may be verbose "-google-readability-todo", // do not require TODO(info) "-bugprone-unhandled-self-assignment", "-bugprone-suspicious-string-compare", "-cert-oop54-cpp", // found in TransactionLog.h "-bugprone-narrowing-conversions", // b/182410845 // TODO(b/275642749) Reenable these warnings "-bugprone-assignment-in-if-condition", "-bugprone-forward-declaration-namespace", "-bugprone-parent-virtual-call", "-cert-dcl59-cpp", "-cert-err34-c", "-google-build-namespaces", "-google-build-using-namespace", "-google-default-arguments", "-google-runtime-int", "-misc-const-correctness", "-misc-non-private-member-variables-in-classes", "-modernize-concat-nested-namespaces", "-modernize-loop-convert", "-modernize-use-default-member-init", "-modernize-use-equals-default", "-modernize-use-nullptr", "-modernize-use-override", "-modernize-use-using", "-performance-no-int-to-ptr", ] // Eventually use common tidy defaults cc_defaults { name: "audioflinger_flags_defaults", // https://clang.llvm.org/docs/UsersManual.html#command-line-options // https://clang.llvm.org/docs/DiagnosticsReference.html cflags: [ "-Wall", "-Wdeprecated", "-Werror", "-Werror=implicit-fallthrough", "-Werror=sometimes-uninitialized", "-Werror=conditional-uninitialized", "-Wextra", // suppress some warning chatter. "-Wno-deprecated-copy-with-dtor", "-Wno-deprecated-copy-with-user-provided-dtor", "-Wredundant-decls", "-Wshadow", "-Wstrict-aliasing", "-fstrict-aliasing", "-Wthread-safety", //"-Wthread-safety-negative", // experimental - looks broken in R. "-Wunreachable-code", "-Wunreachable-code-break", "-Wunreachable-code-return", "-Wunused", "-Wused-but-marked-unused", "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS", ], // https://clang.llvm.org/extra/clang-tidy/ tidy: true, tidy_checks: tidy_errors, tidy_checks_as_errors: tidy_errors, tidy_flags: [ "-format-style=file", ], } cc_library_shared { name: "libaudioflinger", defaults: [ "latest_android_media_audio_common_types_cpp_shared", "latest_android_hardware_audio_core_sounddose_ndk_shared", "audioflinger_flags_defaults", ], srcs: [ "AudioFlinger.cpp", "AudioHwDevice.cpp", "AudioStreamOut.cpp", "AudioWatchdog.cpp", "BufLog.cpp", "DeviceEffectManager.cpp", "Effects.cpp", "FastCapture.cpp", "FastCaptureDumpState.cpp", "FastCaptureState.cpp", "FastMixer.cpp", "FastMixerDumpState.cpp", "FastMixerState.cpp", "FastThread.cpp", "FastThreadDumpState.cpp", "FastThreadState.cpp", "MelReporter.cpp", "NBAIO_Tee.cpp", "PatchCommandThread.cpp", "PatchPanel.cpp", "PropertyUtils.cpp", "SpdifStreamOut.cpp", "StateQueue.cpp", "Threads.cpp", "Tracks.cpp", "TypedLogger.cpp", ], include_dirs: [ "frameworks/av/services/audiopolicy", "frameworks/av/services/medialog", ], shared_libs: [ "audioflinger-aidl-cpp", "audioclient-types-aidl-cpp", "av-types-aidl-cpp", "effect-aidl-cpp", "libaudioclient_aidl_conversion", "libactivitymanager_aidl", "libaudioflinger_timing", "libaudiofoundation", "libaudiohal", "libaudioprocessing", "libaudiospdif", "libaudioutils", "libcutils", "libutils", "liblog", "libbinder", "libbinder_ndk", "libaudioclient", "libaudiomanager", "libmedialogservice", "libmediametrics", "libmediautils", "libnbaio", "libnblog", "libpermission", "libpowermanager", "libmemunreachable", "libmedia_helper", "libshmemcompat", "libsounddose", "libvibrator", "packagemanager_aidl-cpp", ], static_libs: [ "libcpustats", "libsndfile", "libpermission", ], header_libs: [ "libaaudio_headers", "libaudioclient_headers", "libaudiohal_headers", "libaudioutils_headers", "libmedia_headers", ], export_shared_lib_headers: [ "libpermission", "android.hardware.audio.core.sounddose-V1-ndk", ], cflags: [ "-DSTATE_QUEUE_INSTANTIATIONS=\"StateQueueInstantiations.cpp\"", "-fvisibility=hidden", "-Werror", "-Wall", ], sanitize: { integer_overflow: true, }, } cc_library_headers { name: "libaudioflinger_headers", export_include_dirs: ["."], }