Bug 1032460 - Fix getting JNI EGLSurface for Android L r=blassey

This commit is contained in:
James Willcox 2014-07-01 11:43:27 -05:00
parent a293aadf17
commit df72bd0d92

View File

@ -200,7 +200,9 @@ AndroidBridge::Init(JNIEnv *jEnv)
jclass eglClass = getClassGlobalRef("com/google/android/gles_jni/EGLSurfaceImpl");
if (eglClass) {
jEGLSurfacePointerField = getField("mEGLSurface", "I");
// The pointer type moved to a 'long' in Android L, API version 20
const char* jniType = mAPIVersion >= 20 ? "J" : "I";
jEGLSurfacePointerField = getField("mEGLSurface", jniType);
} else {
jEGLSurfacePointerField = 0;
}