1 diff --git a/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp
2 --- a/src/cubeb_aaudio.cpp
3 +++ b/src/cubeb_aaudio.cpp
6 #include "cubeb-internal.h"
7 #include "cubeb/cubeb.h"
8 #include "cubeb_android.h"
10 #include "cubeb_resampler.h"
11 #include "cubeb_triple_buffer.h"
12 #include <aaudio/AAudio.h>
13 +#include <android/api-level.h>
17 #include <condition_variable>
22 @@ -1700,16 +1701,19 @@ const static struct cubeb_ops aaudio_ops
23 /*.stream_get_current_device =*/nullptr,
24 /*.stream_device_destroy =*/nullptr,
25 /*.stream_register_device_changed_callback =*/nullptr,
26 /*.register_device_collection_changed =*/nullptr};
28 extern "C" /*static*/ int
29 aaudio_init(cubeb ** context, char const * /* context_name */)
31 + if (android_get_device_api_level() <= 30) {
35 void * libaaudio = nullptr;
36 #ifndef DISABLE_LIBAAUDIO_DLOPEN
37 libaaudio = dlopen("libaaudio.so", RTLD_NOW);