Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

dalvik: Commit

dalvik


Commit MetaInfo

Revisiond288f74190feb0605b7903a09b0c08cf015d8b7c (tree)
Time2013-09-07 07:20:04
AuthorElliott Hughes <enh@goog...>
CommiterElliott Hughes

Log Message

Support apps that pass JNI_VERSION_1_1 to GetEnv.

Bug: 10649815

(cherry picked from commit 89ee8af81cfe231ed3cd21b050ec16fbcf419683)

Change-Id: If28fab8c87222a9d182398a4deca167a8ca5c677

Change Summary

Incremental Difference

--- a/vm/Jni.cpp
+++ b/vm/Jni.cpp
@@ -2904,7 +2904,9 @@ static jint DetachCurrentThread(JavaVM* vm) {
29042904 static jint GetEnv(JavaVM* vm, void** env, jint version) {
29052905 Thread* self = dvmThreadSelf();
29062906
2907- if (dvmIsBadJniVersion(version)) {
2907+ // GetEnv also accepts JNI_VERSION_1_1, but always returns a JNIEnv*
2908+ // corresponding to the most current supported JNI version.
2909+ if (dvmIsBadJniVersion(version) && version != JNI_VERSION_1_1) {
29082910 ALOGE("Bad JNI version passed to GetEnv: %d", version);
29092911 return JNI_EVERSION;
29102912 }
Show on old repository browser