diff --git a/media/libcubeb/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp index f95f7f01aeaf..d9e85c1ce597 100644 --- a/media/libcubeb/src/cubeb_aaudio.cpp +++ b/media/libcubeb/src/cubeb_aaudio.cpp @@ -11,6 +11,7 @@ #include "cubeb_resampler.h" #include "cubeb_triple_buffer.h" #include +#include #include #include #include @@ -1756,6 +1757,9 @@ const static struct cubeb_ops aaudio_ops = { extern "C" /*static*/ int aaudio_init(cubeb ** context, char const * /* context_name */) { + if (android_get_device_api_level() <= 30) { + return CUBEB_ERROR; + } // load api void * libaaudio = nullptr; #ifndef DISABLE_LIBAAUDIO_DLOPEN diff --git a/media/libcubeb/test/test_duplex.cpp b/media/libcubeb/test/test_duplex.cpp index 518f44f509e1..6a7ca98b1fdf 100644 --- a/media/libcubeb/test/test_duplex.cpp +++ b/media/libcubeb/test/test_duplex.cpp @@ -18,6 +18,8 @@ #include #include +#include "mozilla/gtest/MozHelpers.h" + // #define ENABLE_NORMAL_LOG // #define ENABLE_VERBOSE_LOG #include "common.h" @@ -206,6 +208,8 @@ TEST(cubeb, duplex_collection_change_no_unregister) cubeb * ctx; int r; + mozilla::gtest::DisableCrashReporter(); + r = common_init(&ctx, "Cubeb duplex example with collection change"); ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";