Skip to content

Commit

Permalink
Fixed bug 5278 - export SDL_AndroidRequestPermission() (Thanks Huki!)
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Sep 2, 2020
1 parent f4e02a5 commit 97fad04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/SDL_system.h
Expand Up @@ -198,6 +198,14 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
*/
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);

/**
\brief Request permissions at runtime.
This blocks the calling thread until the permission is granted or
denied. Returns SDL_TRUE if the permission was granted.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);

#endif /* __ANDROID__ */

/* Platform specific functions for WinRT */
Expand Down
5 changes: 5 additions & 0 deletions src/core/android/SDL_android.c
Expand Up @@ -2461,6 +2461,11 @@ const char * SDL_AndroidGetExternalStoragePath(void)
return s_AndroidExternalFilesPath;
}

SDL_bool SDL_AndroidRequestPermission(const char *permission)
{
return Android_JNI_RequestPermission(permission);
}

void Android_JNI_GetManifestEnvironmentVariables(void)
{
if (!mActivityClass || !midGetManifestEnvironmentVariables) {
Expand Down

0 comments on commit 97fad04

Please sign in to comment.