Skip to content

Commit

Permalink
Android: export Lock/Unlock activity API
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Jun 24, 2019
1 parent 7f78d0f commit ccba8d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/android/SDL_android.c
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/core/android/SDL_android.h
Expand Up @@ -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* */
Expand Down

0 comments on commit ccba8d4

Please sign in to comment.