Android: Renamed SDLActivity's Java method used for APK expansion files.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 17 Sep 2015 22:24:54 +0200
changeset 98694ba43d626c4a
parent 9868 c30778c4267d
child 9870 6dd5ab47534b
Android: Renamed SDLActivity's Java method used for APK expansion files.

The name was not correct.
android-project/src/org/libsdl/app/SDLActivity.java
src/core/android/SDL_android.c
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Thu Sep 17 22:21:12 2015 +0200
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Thu Sep 17 22:24:54 2015 +0200
     1.3 @@ -669,7 +669,7 @@
     1.4          }
     1.5      }
     1.6  
     1.7 -    // APK extension files support
     1.8 +    // APK expansion files support
     1.9  
    1.10      /** com.android.vending.expansion.zipfile.ZipResourceFile object or null. */
    1.11      private Object expansionFile;
    1.12 @@ -678,16 +678,25 @@
    1.13      private Method expansionFileMethod;
    1.14  
    1.15      /**
    1.16 +     * This method was called by SDL using JNI.
    1.17 +     * @deprecated because of an incorrect name
    1.18 +     */
    1.19 +    @Deprecated
    1.20 +    public InputStream openAPKExtensionInputStream(String fileName) throws IOException {
    1.21 +        return openAPKExpansionInputStream(fileName);
    1.22 +    }
    1.23 +
    1.24 +    /**
    1.25       * This method is called by SDL using JNI.
    1.26       */
    1.27 -    public InputStream openAPKExtensionInputStream(String fileName) throws IOException {
    1.28 +    public InputStream openAPKExpansionInputStream(String fileName) throws IOException {
    1.29          // Get a ZipResourceFile representing a merger of both the main and patch files
    1.30          if (expansionFile == null) {
    1.31              Integer mainVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
    1.32              Integer patchVersion = Integer.valueOf(nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"));
    1.33  
    1.34              try {
    1.35 -                // To avoid direct dependency on Google APK extension library that is
    1.36 +                // To avoid direct dependency on Google APK expansion library that is
    1.37                  // not a part of Android SDK we access it using reflection
    1.38                  expansionFile = Class.forName("com.android.vending.expansion.zipfile.APKExpansionSupport")
    1.39                      .getMethod("getAPKExpansionZipFile", Context.class, int.class, int.class)
     2.1 --- a/src/core/android/SDL_android.c	Thu Sep 17 22:21:12 2015 +0200
     2.2 +++ b/src/core/android/SDL_android.c	Thu Sep 17 22:24:54 2015 +0200
     2.3 @@ -785,9 +785,9 @@
     2.4                  "open", "(Ljava/lang/String;I)Ljava/io/InputStream;");
     2.5          inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /* ACCESS_RANDOM */);
     2.6          if (Android_JNI_ExceptionOccurred(SDL_FALSE)) {
     2.7 -            // Try fallback to APK Extension files
     2.8 +            /* Try fallback to APK expansion files */
     2.9              mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context),
    2.10 -                "openAPKExtensionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;");
    2.11 +                "openAPKExpansionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;");
    2.12              inputStream = (*mEnv)->CallObjectMethod(mEnv, context, mid, fileNameJString);
    2.13  
    2.14              if (Android_JNI_ExceptionOccurred(SDL_FALSE)) {