aaudio test: test hang in error callback

Call illegal functions that should return an error
but can hang if a race condition is forced.

This test also verifies that the error callback
is not running after the close() is finished.

Bug: 184370309
Test: Manual test. Enter:
Test:     adb shell test_disconnect_race
Test: Then plug/unplug headphones as directed.

Change-Id: I75f2d94329cd1b29cc3e6d275907172a7d7ac592
diff --git a/media/libaaudio/tests/Android.bp b/media/libaaudio/tests/Android.bp
index 62c9b46..f9eebd7 100644
--- a/media/libaaudio/tests/Android.bp
+++ b/media/libaaudio/tests/Android.bp
@@ -250,3 +250,16 @@
         "libutils",
     ],
 }
+
+
+cc_test {
+    name: "test_disconnect_race",
+    defaults: ["libaaudio_tests_defaults"],
+    srcs: ["test_disconnect_race.cpp"],
+    shared_libs: [
+        "libaaudio",
+        "libbinder",
+        "libcutils",
+        "libutils",
+    ],
+}