diff options
author | Christian Strømme <christian.stromme@theqtcompany.com> | 2014-10-30 19:23:40 +0100 |
---|---|---|
committer | Christian Stromme <christian.stromme@digia.com> | 2014-11-03 18:25:21 +0100 |
commit | 0df7ab1cabfd84c88b290cf784be6d51fb4f656a (patch) | |
tree | 7cda2d08803933fe661d70d3646bc2be18a61e0d /src/plugins/platforms/android/androidjnimain.h | |
parent | 078380df1e14ac82b3cf3ad66ae50d5351709537 (diff) |
Android: Remove AttachedJNIEnv class.
The JNI environment should be managed by QJNIEnvironmentPrivate
directly or through QJNIObjectPrivate. There is also a clear
difference between calls coming from or going into Java code.
Calls coming from Java already comes with the 'right' environment and
in most cases no extra considerations or set-up is needed.
Change-Id: I92d935ddfb70332041869185d5a92438930ff9b9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/android/androidjnimain.h')
-rw-r--r-- | src/plugins/platforms/android/androidjnimain.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.h b/src/plugins/platforms/android/androidjnimain.h index 01330ce283..8cf9274857 100644 --- a/src/plugins/platforms/android/androidjnimain.h +++ b/src/plugins/platforms/android/androidjnimain.h @@ -85,29 +85,6 @@ namespace QtAndroid jobject createBitmap(int width, int height, QImage::Format format, JNIEnv *env); jobject createBitmapDrawable(jobject bitmap, JNIEnv *env = 0); - struct AttachedJNIEnv - { - AttachedJNIEnv() - { - attached = false; - if (QtAndroid::javaVM()->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) < 0) { - if (QtAndroid::javaVM()->AttachCurrentThread(&jniEnv, NULL) < 0) { - __android_log_print(ANDROID_LOG_ERROR, "Qt", "AttachCurrentThread failed"); - jniEnv = Q_NULLPTR; - return; - } - attached = true; - } - } - - ~AttachedJNIEnv() - { - if (attached) - QtAndroid::javaVM()->DetachCurrentThread(); - } - bool attached; - JNIEnv *jniEnv; - }; const char *classErrorMsgFmt(); const char *methodErrorMsgFmt(); const char *qtTagText(); |