src/core/android/SDL_android.c
changeset 11688 e4d90d54cb01
parent 11678 1f10a52295e3
child 11715 35da714ed287
     1.1 --- a/src/core/android/SDL_android.c	Sat Nov 04 21:58:48 2017 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Sat Nov 04 22:03:28 2017 -0700
     1.3 @@ -251,7 +251,7 @@
     1.4  static float fLastAccelerometer[3];
     1.5  static SDL_bool bHasNewData;
     1.6  
     1.7 -static SDL_bool bHasEnvironmentVariables;
     1.8 +static SDL_bool bHasEnvironmentVariables = SDL_FALSE;
     1.9  
    1.10  /*******************************************************************************
    1.11                   Functions called by JNI
    1.12 @@ -324,7 +324,7 @@
    1.13                                  "openAPKExpansionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;");
    1.14  
    1.15      midGetManifestEnvironmentVariables = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.16 -                                "getManifestEnvironmentVariables", "()V");
    1.17 +                                "getManifestEnvironmentVariables", "()Z");
    1.18  
    1.19      midGetDisplayDPI = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;");
    1.20  
    1.21 @@ -831,12 +831,6 @@
    1.22  
    1.23  }
    1.24  
    1.25 -JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeEnvironmentVariablesSet)(
    1.26 -        JNIEnv* env, jclass cls)
    1.27 -{
    1.28 -    bHasEnvironmentVariables = SDL_TRUE;
    1.29 -}
    1.30 -
    1.31  /*******************************************************************************
    1.32               Functions called by SDL into Java
    1.33  *******************************************************************************/
    1.34 @@ -2143,7 +2137,10 @@
    1.35  
    1.36      if (!bHasEnvironmentVariables) {
    1.37          JNIEnv *env = Android_JNI_GetEnv();
    1.38 -        (*env)->CallStaticVoidMethod(env, mActivityClass, midGetManifestEnvironmentVariables);
    1.39 +        SDL_bool ret = (*env)->CallStaticBooleanMethod(env, mActivityClass, midGetManifestEnvironmentVariables);
    1.40 +        if (ret) {
    1.41 +            bHasEnvironmentVariables = SDL_TRUE;
    1.42 +        }
    1.43      }
    1.44  }
    1.45