summaryrefslogtreecommitdiffstats
path: root/apps/hosted/android/notification.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 18:34:35 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 18:34:35 +0000
commit66f2a08f8a37933b9eff79ceabdc2cb42706e48c (patch)
tree704cd88300e33a99335adf1d5e3e4ff6b71a2aed /apps/hosted/android/notification.c
parent2e5b7aebde6426058ea7b69424b0335a844a6a18 (diff)
downloadrockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.tar.gz
rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.tar.bz2
rockbox-66f2a08f8a37933b9eff79ceabdc2cb42706e48c.zip
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/notification.c')
-rw-r--r--apps/hosted/android/notification.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/hosted/android/notification.c b/apps/hosted/android/notification.c
index 33a7717012..1c89c51357 100644
--- a/apps/hosted/android/notification.c
+++ b/apps/hosted/android/notification.c
@@ -29,8 +29,8 @@
#include "misc.h"
#include "thread.h"
#include "debug.h"
+#include "system.h"
-extern JNIEnv *env_ptr;
extern jclass RockboxService_class;
extern jobject RockboxService_instance;
@@ -47,6 +47,7 @@ static const struct dim dim = { .width = 200, .height = 200 };
static void track_changed_callback(void *param)
{
struct mp3entry* id3 = (struct mp3entry*)param;
+ JNIEnv *env_ptr = getJavaEnvironment();
JNIEnv e = *env_ptr;
if (id3)
{
@@ -109,6 +110,7 @@ static void track_changed_callback(void *param)
static void track_finished_callback(void *param)
{
(void)param;
+ JNIEnv *env_ptr = getJavaEnvironment();
JNIEnv e = *env_ptr;
e->CallVoidMethod(env_ptr, NotificationManager_instance,
finishNotification);
@@ -122,6 +124,7 @@ static void track_finished_callback(void *param)
void notification_init(void)
{
+ JNIEnv *env_ptr = getJavaEnvironment();
JNIEnv e = *env_ptr;
jfieldID nNM = e->GetFieldID(env_ptr, RockboxService_class,
"fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;");