From 046cec3aa7fd58a9519cad8d693b47a2400e1742 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 16 Mar 2011 14:33:55 +0000 Subject: 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 --- apps/hosted/android/notification.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apps/hosted/android/notification.c') diff --git a/apps/hosted/android/notification.c b/apps/hosted/android/notification.c index e7c425b7c1..443200698c 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,7 +47,6 @@ 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) { @@ -110,7 +109,6 @@ 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); @@ -124,7 +122,6 @@ 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;"); -- cgit v1.2.3