Fixing issues discovered by Philipp Wiesemann apk
authorstopiccot <alexey.petruchik@gmail.com>
Wed, 23 Apr 2014 03:42:32 +0300
branchapk
changeset 8897 fff9c0b9f1fb
parent 8896 d931167c375a
child 8898 0f1bfc218f62
Fixing issues discovered by Philipp Wiesemann
android-project/src/org/libsdl/app/SDLActivity.java
include/SDL_hints.h
src/core/android/SDL_android.c
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Mon Apr 07 21:20:39 2014 +0300
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Wed Apr 23 03:42:32 2014 +0300
@@ -300,7 +300,7 @@
                                                int is_accelerometer, int nbuttons, 
                                                int naxes, int nhats, int nballs);
     public static native int nativeRemoveJoystick(int device_id);
-    public static native String getHint(String name);
+    public static native String nativeGetHint(String name);
 
     public static void flipBuffers() {
         SDLActivity.nativeFlipBuffers();
@@ -507,8 +507,8 @@
     public InputStream openAPKExtensionInputStream(String fileName) throws IOException {
         // Get a ZipResourceFile representing a merger of both the main and patch files
         if (expansionFile == null) {
-            Integer mainVersion = Integer.parseInt(getHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
-            Integer patchVersion = Integer.parseInt(getHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
+            Integer mainVersion = Integer.parseInt(nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
+            Integer patchVersion = Integer.parseInt(nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"));
 
             expansionFile = APKExpansionSupport.getAPKExpansionZipFile(this, mainVersion, patchVersion);
         }
--- a/include/SDL_hints.h	Mon Apr 07 21:20:39 2014 +0300
+++ b/include/SDL_hints.h	Wed Apr 23 03:42:32 2014 +0300
@@ -443,7 +443,7 @@
 /**
  * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
  */
-#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_PATCH_VERSION"
+#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
 
 
 /**
--- a/src/core/android/SDL_android.c	Mon Apr 07 21:20:39 2014 +0300
+++ b/src/core/android/SDL_android.c	Wed Apr 23 03:42:32 2014 +0300
@@ -385,7 +385,7 @@
     (*env)->ReleaseStringUTFChars(env, text, utftext);
 }
 
-jstring Java_org_libsdl_app_SDLActivity_getHint(JNIEnv* env, jclass cls, jstring name) {
+jstring Java_org_libsdl_app_SDLActivity_nativeGetHint(JNIEnv* env, jclass cls, jstring name) {
     const char *utfname = (*env)->GetStringUTFChars(env, name, NULL);
     const char *hint = SDL_GetHint(utfname);