AudioFlinger: Group common tidy check parameters together

Test: compiles with clang-tidy enabled
Bug: 286936439
Change-Id: Ib87b375afb74c5d07ec44a312baef712f450bad8
diff --git a/services/audioflinger/Android.bp b/services/audioflinger/Android.bp
index c6ce51f..4ebfa10 100644
--- a/services/audioflinger/Android.bp
+++ b/services/audioflinger/Android.bp
@@ -19,7 +19,8 @@
     ],
 }
 
-tidy_errors = [
+// base tidy_errors for this and all subprojects.
+audioflinger_base_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,
@@ -71,8 +72,10 @@
     "-bugprone-suspicious-string-compare",
     "-cert-oop54-cpp", // found in TransactionLog.h
     "-bugprone-narrowing-conversions", // b/182410845
+]
 
-    // TODO(b/275642749) Reenable these warnings
+// TODO(b/275642749) Reenable these warnings
+audioflinger_tidy_errors = audioflinger_base_tidy_errors + [
     "-bugprone-assignment-in-if-condition",
     "-bugprone-forward-declaration-namespace",
     "-bugprone-parent-virtual-call",
@@ -127,8 +130,8 @@
     ],
     // https://clang.llvm.org/extra/clang-tidy/
     tidy: true,
-    tidy_checks: tidy_errors,
-    tidy_checks_as_errors: tidy_errors,
+    tidy_checks: audioflinger_tidy_errors,
+    tidy_checks_as_errors: audioflinger_tidy_errors,
     tidy_flags: [
       "-format-style=file",
     ],
diff --git a/services/audioflinger/afutils/Android.bp b/services/audioflinger/afutils/Android.bp
index 5eac519..2992002 100644
--- a/services/audioflinger/afutils/Android.bp
+++ b/services/audioflinger/afutils/Android.bp
@@ -7,60 +7,8 @@
     default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
 }
 
-audioflinger_utils_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
+// TODO(b/275642749) Reenable these warnings
+audioflinger_utils_tidy_errors = audioflinger_base_tidy_errors + [
     "-misc-non-private-member-variables-in-classes",
 ]
 
diff --git a/services/audioflinger/fastpath/Android.bp b/services/audioflinger/fastpath/Android.bp
index 6c024e7..76f9af4 100644
--- a/services/audioflinger/fastpath/Android.bp
+++ b/services/audioflinger/fastpath/Android.bp
@@ -7,60 +7,8 @@
     default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
 }
 
-fastpath_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
+// TODO(b/275642749) Reenable these warnings
+fastpath_tidy_errors = audioflinger_base_tidy_errors + [
     "-misc-non-private-member-variables-in-classes",
     "-performance-no-int-to-ptr",
 ]
diff --git a/services/audioflinger/sounddose/Android.bp b/services/audioflinger/sounddose/Android.bp
index d659261..b128da1 100644
--- a/services/audioflinger/sounddose/Android.bp
+++ b/services/audioflinger/sounddose/Android.bp
@@ -7,59 +7,14 @@
     default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
 }
 
-audioflinger_sounddose_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",
+audioflinger_sounddose_tidy_errors = audioflinger_base_tidy_errors + [
+    "modernize-avoid-c-arrays",
+    "modernize-deprecated-headers",
     "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",  // 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-auto",
     "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
     "-misc-non-private-member-variables-in-classes",
 ]