Commit 0c698c71 authored by Thomas Guillem's avatar Thomas Guillem

android/specific: a missing Environment field is not critical

The DIRECTORY_DOCUMENTS field is not present before API 19. Not finding a field
is not critical (config_GetUserDir() will just return null for that field).
parent dedcaac8
......@@ -51,7 +51,10 @@ get_java_string(JNIEnv *env, jclass clazz, const char *psz_name)
jfieldID id = (*env)->GetStaticFieldID(env, clazz, psz_name,
if ((*env)->ExceptionCheck(env))
return NULL;
jstring jstr = (*env)->GetStaticObjectField(env, clazz, id);
......@@ -113,12 +116,8 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
for (size_t i = 0; i < GENERIC_DIR_COUNT; ++i)
if (ppsz_env_names[i] != NULL)
ppsz_generic_names[i] = get_java_string(env, clazz,
if (!ppsz_generic_names[i])
goto error;
fields.Environment.clazz = (*env)->NewGlobalRef(env, clazz);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment