diff --git a/media/libcubeb/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp index 4b7774e38f5f..fe5971bc847d 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 @@ -1704,6 +1705,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