Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
inital apk extension support
- Loading branch information
File 3 of 3 in
612f4a6
|
@@ -385,7 +385,15 @@ void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText( |
|
|
(*env)->ReleaseStringUTFChars(env, text, utftext); |
|
|
} |
|
|
|
|
|
jstring Java_org_libsdl_app_SDLActivity_getHint(JNIEnv* env, jclass cls, jstring name) { |
|
|
const char *utfname = (*env)->GetStringUTFChars(env, name, NULL); |
|
|
const char *hint = SDL_GetHint(utfname); |
|
|
|
|
|
jstring result = (*env)->NewStringUTF(env, hint); |
|
|
(*env)->ReleaseStringUTFChars(env, name, utfname); |
|
|
|
|
|
return result; |
|
|
} |
|
|
|
|
|
/******************************************************************************* |
|
|
Functions called by SDL into Java |
|
@@ -758,7 +766,14 @@ static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) |
|
|
"open", "(Ljava/lang/String;I)Ljava/io/InputStream;"); |
|
|
inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /* ACCESS_RANDOM */); |
|
|
if (Android_JNI_ExceptionOccurred(false)) { |
|
|
goto failure; |
|
|
// Try fallback to APK Extension files |
|
|
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context), |
|
|
"openAPKExtensionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;"); |
|
|
inputStream = (*mEnv)->CallObjectMethod(mEnv, context, mid, fileNameJString); |
|
|
|
|
|
if (Android_JNI_ExceptionOccurred(false)) { |
|
|
goto failure; |
|
|
} |
|
|
} |
|
|
|
|
|
ctx->hidden.androidio.inputStreamRef = (*mEnv)->NewGlobalRef(mEnv, inputStream); |
|
|
Oops, something went wrong.