summaryrefslogtreecommitdiffstats
path: root/apps/hosted/android/keyboard.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-03-16 14:33:55 +0000
committerThomas Martitz <kugel@rockbox.org>2011-03-16 14:33:55 +0000
commit046cec3aa7fd58a9519cad8d693b47a2400e1742 (patch)
treecb0ba0773a3e8b3cef5d7690e2822f03d1425ddb /apps/hosted/android/keyboard.c
parentefa9f13500d1672d0b631520e92e08f3ff61e45c (diff)
downloadrockbox-046cec3aa7fd58a9519cad8d693b47a2400e1742.tar.gz
rockbox-046cec3aa7fd58a9519cad8d693b47a2400e1742.tar.bz2
rockbox-046cec3aa7fd58a9519cad8d693b47a2400e1742.zip
Android: Partly revert r29569 and only call the new getJavaEnvironment() when needed.
The environment is fine to share in general, just not across OS threads, so it's only needed for functions which are possibly called from multiple OS threads (only 1 currently). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29601 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/hosted/android/keyboard.c')
-rw-r--r--apps/hosted/android/keyboard.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/hosted/android/keyboard.c b/apps/hosted/android/keyboard.c
index f9bbcbb261..9407d970fd 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,9 +53,7 @@ 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)
{
@@ -86,7 +84,6 @@ 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));