diff --git a/src/xrt/include/xrt/xrt_config_os.h b/src/xrt/include/xrt/xrt_config_os.h index 2894eae3c..20d761672 100644 --- a/src/xrt/include/xrt/xrt_config_os.h +++ b/src/xrt/include/xrt/xrt_config_os.h @@ -18,6 +18,7 @@ #if defined(__ANDROID__) #define XRT_OS_ANDROID +#define XRT_OS_ANDROID_USE_AHB #define XRT_OS_LINUX #define XRT_OS_UNIX #define XRT_OS_WAS_AUTODETECTED diff --git a/src/xrt/include/xrt/xrt_handles.h b/src/xrt/include/xrt/xrt_handles.h index 4b1f46772..3edcdca0e 100644 --- a/src/xrt/include/xrt/xrt_handles.h +++ b/src/xrt/include/xrt/xrt_handles.h @@ -187,7 +187,7 @@ xrt_shmem_is_valid(xrt_shmem_handle_t handle) * */ -#if defined(XRT_OS_ANDROID) && (__ANDROID_API__ >= 26) +#if defined(XRT_OS_ANDROID) && defined(XRT_OS_ANDROID_USE_AHB) && (__ANDROID_API__ >= 26) typedef struct AHardwareBuffer AHardwareBuffer; /*! @@ -235,7 +235,7 @@ xrt_graphics_buffer_is_valid(xrt_graphics_buffer_handle_t handle) */ #define XRT_GRAPHICS_BUFFER_HANDLE_INVALID NULL -#elif defined(XRT_OS_LINUX) +#elif defined(XRT_OS_ANDROID) && !defined(XRT_OS_ANDROID_USE_AHB) || defined(XRT_OS_LINUX) /*! * The type underlying buffers shared between compositor clients and the main