AudioFlinger: Add datapath subproject

Test: ALLOW_LOCAL_TIDY_TRUE=1 mm -j .
Bug: 287521708
Merged-In: I1fbe85ff5c5fc58a3e49fa137b4247b33f919ecb
Change-Id: I1fbe85ff5c5fc58a3e49fa137b4247b33f919ecb
(cherry picked from commit 76913a08cba261ea59ca436ee99ff1ea3f2de6e8)
diff --git a/services/audioflinger/datapath/Android.bp b/services/audioflinger/datapath/Android.bp
new file mode 100644
index 0000000..58f0422
--- /dev/null
+++ b/services/audioflinger/datapath/Android.bp
@@ -0,0 +1,64 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_base_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
+}
+
+audioflinger_datapath_tidy_errors = audioflinger_base_tidy_errors + [
+    "modernize-avoid-c-arrays",
+    "modernize-deprecated-headers",
+    "modernize-pass-by-value",
+    "modernize-use-auto",
+    "modernize-use-nodiscard",
+
+    // TODO(b/275642749) Reenable these warnings
+    "-misc-non-private-member-variables-in-classes",
+]
+
+// Eventually use common tidy defaults
+cc_defaults {
+    name: "audioflinger_datapath_flags_defaults",
+    // https://clang.llvm.org/docs/UsersManual.html#command-line-options
+    // https://clang.llvm.org/docs/DiagnosticsReference.html
+    cflags: audioflinger_base_cflags,
+    // https://clang.llvm.org/extra/clang-tidy/
+    tidy: true,
+    tidy_checks: audioflinger_datapath_tidy_errors,
+    tidy_checks_as_errors: audioflinger_datapath_tidy_errors,
+    tidy_flags: [
+      "-format-style=file",
+    ],
+}
+
+cc_library {
+    name: "libaudioflinger_datapath",
+
+    defaults: [
+        "audioflinger_datapath_flags_defaults",
+        "latest_android_media_audio_common_types_cpp_shared",
+    ],
+
+    srcs: [
+        "AudioHwDevice.cpp",
+        "AudioStreamOut.cpp",
+        "SpdifStreamOut.cpp",
+    ],
+
+    header_libs: [
+        "libaudiohal_headers",
+        "liberror_headers",
+    ],
+
+    shared_libs: [
+        "audioclient-types-aidl-cpp",
+        "av-types-aidl-cpp",
+        "libaudiospdif",
+        "libaudioutils",
+        "libbase",
+        "liblog",
+        "libutils", // refbase
+    ],
+}