summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorGravatar t8952024-02-05 06:49:01 -0500
committerGravatar t8952024-02-08 14:13:46 -0500
commit2600ac65c8101c69988f2506739e6ddef05b23c7 (patch)
tree286b6e4beb914b46c548a56e1cb4424a095d4124 /src/android
parentcommon: fs: Expand android macros (diff)
downloadyuzu-2600ac65c8101c69988f2506739e6ddef05b23c7.tar.gz
yuzu-2600ac65c8101c69988f2506739e6ddef05b23c7.tar.xz
yuzu-2600ac65c8101c69988f2506739e6ddef05b23c7.zip
android: Run OnEmulationStarted frontend callback in another thread
The JVM has problems with attaching to a Fiber so we start a new thread and wait for the result here.
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/jni/emu_window/emu_window.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp
index c4f631924..c927cddda 100644
--- a/src/android/app/src/main/jni/emu_window/emu_window.cpp
+++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp
@@ -3,6 +3,7 @@
3 3
4#include <android/native_window_jni.h> 4#include <android/native_window_jni.h>
5 5
6#include "common/android/id_cache.h"
6#include "common/logging/log.h" 7#include "common/logging/log.h"
7#include "input_common/drivers/touch_screen.h" 8#include "input_common/drivers/touch_screen.h"
8#include "input_common/drivers/virtual_amiibo.h" 9#include "input_common/drivers/virtual_amiibo.h"
@@ -60,7 +61,8 @@ void EmuWindow_Android::OnRemoveNfcTag() {
60 61
61void EmuWindow_Android::OnFrameDisplayed() { 62void EmuWindow_Android::OnFrameDisplayed() {
62 if (!m_first_frame) { 63 if (!m_first_frame) {
63 EmulationSession::GetInstance().OnEmulationStarted(); 64 Common::Android::RunJNIOnFiber<void>(
65 [&](JNIEnv* env) { EmulationSession::GetInstance().OnEmulationStarted(); });
64 m_first_frame = true; 66 m_first_frame = true;
65 } 67 }
66} 68}