diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2011-03-11 18:34:35 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2011-03-11 18:34:35 +0000 |
| commit | 66f2a08f8a37933b9eff79ceabdc2cb42706e48c (patch) | |
| tree | 704cd88300e33a99335adf1d5e3e4ff6b71a2aed /apps/hosted/android/keyboard.c | |
| parent | 2e5b7aebde6426058ea7b69424b0335a844a6a18 (diff) | |
| download | rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.zip rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.tar.gz rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.tar.bz2 rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.tar.xz | |
Android: Don't share the JNI environment across threads, but obtain it the
correct way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29569 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/hosted/android/keyboard.c')
| -rw-r--r-- | apps/hosted/android/keyboard.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/hosted/android/keyboard.c b/apps/hosted/android/keyboard.c index 7c16cff..460011c 100644 --- a/apps/hosted/android/keyboard.c +++ b/apps/hosted/android/keyboard.c @@ -26,8 +26,8 @@ #include "string-extra.h" #include "kernel.h" #include "lang.h" +#include "system.h" -extern JNIEnv *env_ptr; static jclass RockboxKeyboardInput_class; static jobject RockboxKeyboardInput_instance; static jmethodID kbd_inputfunc; @@ -53,7 +53,9 @@ Java_org_rockbox_RockboxKeyboardInput_put_1result(JNIEnv *env, jobject this, static void kdb_init(void) { + JNIEnv *env_ptr = getJavaEnvironment(); JNIEnv e = *env_ptr; + static jmethodID kbd_is_usable; if (RockboxKeyboardInput_class == NULL) { @@ -87,6 +89,7 @@ static void kdb_init(void) int kbd_input(char* text, int buflen) { + JNIEnv *env_ptr = getJavaEnvironment(); JNIEnv e = *env_ptr; jstring str = e->NewStringUTF(env_ptr, text); jstring ok_text = e->NewStringUTF(env_ptr, str(LANG_KBD_OK)); |