Fixed bug 3917 - Android, issues with getManifestEnvironmentVariable

We're going to push the manifest environment variables from the Java side instead of continually querying for them from the native side.
This commit is contained in:
Sam Lantinga
2017-11-04 09:37:29 -07:00
parent 7334a2a1b5
commit 758156a765
4 changed files with 67 additions and 63 deletions

View File

@@ -171,23 +171,17 @@ SDL_setenv(const char *name, const char *value, int overwrite)
#endif
/* Retrieve a variable named "name" from the environment */
#if defined(HAVE_GETENV)
char *
SDL_getenv(const char *name)
{
#if defined(__ANDROID__)
char *
SDL_getenv(const char *name)
{
/* Input validation */
if (!name || SDL_strlen(name)==0) {
return NULL;
}
/* Make sure variables from the application manifest are available */
Android_JNI_GetManifestEnvironmentVariables();
#endif
return SDL_AndroidGetManifestEnvironmentVariable(name);
}
#elif defined(HAVE_GETENV)
char *
SDL_getenv(const char *name)
{
/* Input validation */
if (!name || SDL_strlen(name)==0) {
if (!name || !*name) {
return NULL;
}