From 47a83b42b50cbe8144e34fdca8702441a8ffe7ec Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 5 Apr 2024 16:33:12 +0200 Subject: [PATCH] Setup JNI for threads that may use it OpenXR runtime may use JNI, so attach threads that will do OpenXR calls. --- client/scenes/stream_network.cpp | 5 +++++ client/scenes/stream_tracking.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/client/scenes/stream_network.cpp b/client/scenes/stream_network.cpp index 6a374d51..ce098de8 100644 --- a/client/scenes/stream_network.cpp +++ b/client/scenes/stream_network.cpp @@ -18,11 +18,16 @@ */ #include "stream.h" + +#include "application.h" #include "utils/named_thread.h" #include void scenes::stream::process_packets() { +#ifdef __ANDROID__ + application::instance().setup_jni(); +#endif while (not exiting) { try diff --git a/client/scenes/stream_tracking.cpp b/client/scenes/stream_tracking.cpp index c0f6b04f..e0655da5 100644 --- a/client/scenes/stream_tracking.cpp +++ b/client/scenes/stream_tracking.cpp @@ -108,6 +108,10 @@ static std::optional> spaces = { {device_id::HEAD, application::view()}, {device_id::LEFT_AIM, application::left_aim()},