Skip to content

Commit

Permalink
url: patched to compile on Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 5, 2020
1 parent 84f1b95 commit 5f68812
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/core/android/SDL_android.c
Expand Up @@ -2284,6 +2284,11 @@ void *SDL_AndroidGetActivity(void)
return (*env)->CallStaticObjectMethod(env, mActivityClass, midGetContext);
}

jclass Android_GetActivityClass(void)
{
return mActivityClass;
}

int SDL_GetAndroidSDKVersion(void)
{
static int sdk_version;
Expand Down
2 changes: 2 additions & 0 deletions src/core/android/SDL_android.h
Expand Up @@ -140,6 +140,8 @@ void Android_ActivityMutex_Lock(void);
void Android_ActivityMutex_Unlock(void);
void Android_ActivityMutex_Lock_Running(void);

jclass Android_GetActivityClass(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
Expand Down
1 change: 0 additions & 1 deletion src/misc/SDL_url.c
Expand Up @@ -18,7 +18,6 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#include "../SDL_internal.h"
#include "SDL_error.h"

Expand Down
1 change: 1 addition & 0 deletions src/misc/android/SDL_sysurl.c
Expand Up @@ -25,6 +25,7 @@
int
SDL_SYS_OpenURL(const char *url)
{
jclass mActivityClass = Android_GetActivityClass();
JNIEnv *env = Android_JNI_GetEnv();
jstring jurl = (*env)->NewStringUTF(env, url);
const int ret = (*env)->CallStaticIntMethod(env, mActivityClass, midOpenURL, jurl);
Expand Down

0 comments on commit 5f68812

Please sign in to comment.