1// Copyright (C) 2019 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "frameworks_av_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["frameworks_av_license"], 22} 23 24tidy_errors = [ 25 // https://clang.llvm.org/extra/clang-tidy/checks/list.html 26 // For many categories, the checks are too many to specify individually. 27 // Feel free to disable as needed - as warnings are generally ignored, 28 // we treat warnings as errors. 29 "android-*", 30 "bugprone-*", 31 "cert-*", 32 "clang-analyzer-security*", 33 "google-*", 34 "misc-*", 35 //"modernize-*", // explicitly list the modernize as they can be subjective. 36 "modernize-avoid-bind", 37 //"modernize-avoid-c-arrays", // std::array<> can be verbose 38 "modernize-concat-nested-namespaces", 39 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. 40 "modernize-deprecated-ios-base-aliases", 41 "modernize-loop-convert", 42 "modernize-make-shared", 43 "modernize-make-unique", 44 "modernize-pass-by-value", 45 "modernize-raw-string-literal", 46 "modernize-redundant-void-arg", 47 "modernize-replace-auto-ptr", 48 "modernize-replace-random-shuffle", 49 "modernize-return-braced-init-list", 50 "modernize-shrink-to-fit", 51 "modernize-unary-static-assert", 52 "modernize-use-auto", 53 "modernize-use-bool-literals", 54 "modernize-use-default-member-init", 55 "modernize-use-emplace", 56 "modernize-use-equals-default", 57 "modernize-use-equals-delete", 58 "modernize-use-nodiscard", 59 "modernize-use-noexcept", 60 "modernize-use-nullptr", 61 "modernize-use-override", 62 // "modernize-use-trailing-return-type", // not necessarily more readable 63 "modernize-use-transparent-functors", 64 "modernize-use-uncaught-exceptions", 65 "modernize-use-using", 66 "performance-*", 67 68 // Remove some pedantic stylistic requirements. 69 "-android-cloexec-dup", // found in AAudioServiceEndpointMMAP.cpp 70 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t 71 72 "-google-build-using-namespace", // Reenable and fix later. 73 "-google-global-names-in-headers", // found in several files 74 "-google-readability-casting", // C++ casts not always necessary and may be verbose 75 "-google-readability-todo", // do not require TODO(info) 76 77 "-misc-non-private-member-variables-in-classes", // found in aidl generated files 78 79] 80 81cc_defaults { 82 name: "libaaudioservice_dependencies", 83 84 shared_libs: [ 85 "aaudio-aidl-cpp", 86 "com.android.media.aaudio-aconfig-cc", 87 "com.android.media.aaudio-aconfig-cc", 88 "framework-permission-aidl-cpp", 89 "libaaudio_internal", 90 "libaudioclient", 91 "libaudioclient_aidl_conversion", 92 "libaudiofoundation", 93 "libaudioutils", 94 "libbase", 95 "libbinder", 96 "libcutils", 97 "liblog", 98 "libmedia_helper", 99 "libmediametrics", 100 "libmediautils", 101 "libutils", 102 "packagemanager_aidl-cpp", 103 ], 104 105 static_libs: [ 106 "libaudioflinger", 107 ], 108} 109 110cc_library_static { 111 112 name: "libaaudioservice", 113 114 defaults: [ 115 "latest_android_media_audio_common_types_cpp_shared", 116 "libaaudioservice_dependencies", 117 ], 118 119 srcs: [ 120 "AAudioClientTracker.cpp", 121 "AAudioCommandQueue.cpp", 122 "AAudioEndpointManager.cpp", 123 "AAudioMixer.cpp", 124 "AAudioService.cpp", 125 "AAudioServiceEndpoint.cpp", 126 "AAudioServiceEndpointCapture.cpp", 127 "AAudioServiceEndpointMMAP.cpp", 128 "AAudioServiceEndpointPlay.cpp", 129 "AAudioServiceEndpointShared.cpp", 130 "AAudioServiceStreamBase.cpp", 131 "AAudioServiceStreamMMAP.cpp", 132 "AAudioServiceStreamShared.cpp", 133 "AAudioStreamTracker.cpp", 134 "AAudioThread.cpp", 135 "SharedMemoryProxy.cpp", 136 "SharedMemoryWrapper.cpp", 137 "SharedRingBuffer.cpp", 138 "TimestampScheduler.cpp", 139 ], 140 141 cflags: [ 142 "-Wall", 143 "-Werror", 144 "-Wno-unused-parameter", 145 "-Wthread-safety", 146 ], 147 148 export_shared_lib_headers: [ 149 "framework-permission-aidl-cpp", 150 "libaaudio_internal", 151 ], 152 153 header_libs: [ 154 "libaudiohal_headers", 155 ], 156 157 include_dirs: [ 158 "frameworks/av/media/libnbaio/include", 159 "frameworks/av/media/libnbaio/include_mono", 160 ], 161 162 export_include_dirs: ["."], 163 164 tidy: true, 165 tidy_checks: tidy_errors, 166 tidy_checks_as_errors: tidy_errors, 167 tidy_flags: [ 168 "-format-style=file", 169 ], 170} 171