From ccba8d469174b3cb0afb4eb5431ebe824ed83c53 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Mon, 24 Jun 2019 18:08:11 +0200 Subject: [PATCH] Android: export Lock/Unlock activity API --- src/core/android/SDL_android.c | 9 +++++++++ src/core/android/SDL_android.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index a4a2e1ce0..b0a2be397 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -711,6 +711,15 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)( SDL_SendDropComplete(NULL); } +/* Lock / Unlock Mutex */ +void Android_ActivityMutex_Lock() { + SDL_LockMutex(Android_ActivityMutex); +} + +void Android_ActivityMutex_Unlock() { + SDL_UnlockMutex(Android_ActivityMutex); +} + /* Set screen resolution */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetScreenResolution)( JNIEnv *env, jclass jcls, diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h index 837c3a4a7..b345b05ce 100644 --- a/src/core/android/SDL_android.h +++ b/src/core/android/SDL_android.h @@ -131,6 +131,9 @@ SDL_bool SDL_IsAndroidTV(void); SDL_bool SDL_IsChromebook(void); SDL_bool SDL_IsDeXMode(void); +void Android_ActivityMutex_Lock(void); +void Android_ActivityMutex_Unlock(void); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus /* *INDENT-OFF* */