diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-03-16 14:33:55 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-03-16 14:33:55 +0000 |
commit | 046cec3aa7fd58a9519cad8d693b47a2400e1742 (patch) | |
tree | cb0ba0773a3e8b3cef5d7690e2822f03d1425ddb /apps/hosted/android/notification.c | |
parent | efa9f13500d1672d0b631520e92e08f3ff61e45c (diff) | |
download | rockbox-046cec3aa7fd58a9519cad8d693b47a2400e1742.tar.gz 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/notification.c')
-rw-r--r-- | apps/hosted/android/notification.c | 5 |
1 files changed, 1 insertions, 4 deletions
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 @@ | |||
29 | #include "misc.h" | 29 | #include "misc.h" |
30 | #include "thread.h" | 30 | #include "thread.h" |
31 | #include "debug.h" | 31 | #include "debug.h" |
32 | #include "system.h" | ||
33 | 32 | ||
33 | extern JNIEnv *env_ptr; | ||
34 | extern jclass RockboxService_class; | 34 | extern jclass RockboxService_class; |
35 | extern jobject RockboxService_instance; | 35 | extern jobject RockboxService_instance; |
36 | 36 | ||
@@ -47,7 +47,6 @@ static const struct dim dim = { .width = 200, .height = 200 }; | |||
47 | static void track_changed_callback(void *param) | 47 | static void track_changed_callback(void *param) |
48 | { | 48 | { |
49 | struct mp3entry* id3 = (struct mp3entry*)param; | 49 | struct mp3entry* id3 = (struct mp3entry*)param; |
50 | JNIEnv *env_ptr = getJavaEnvironment(); | ||
51 | JNIEnv e = *env_ptr; | 50 | JNIEnv e = *env_ptr; |
52 | if (id3) | 51 | if (id3) |
53 | { | 52 | { |
@@ -110,7 +109,6 @@ static void track_changed_callback(void *param) | |||
110 | static void track_finished_callback(void *param) | 109 | static void track_finished_callback(void *param) |
111 | { | 110 | { |
112 | (void)param; | 111 | (void)param; |
113 | JNIEnv *env_ptr = getJavaEnvironment(); | ||
114 | JNIEnv e = *env_ptr; | 112 | JNIEnv e = *env_ptr; |
115 | e->CallVoidMethod(env_ptr, NotificationManager_instance, | 113 | e->CallVoidMethod(env_ptr, NotificationManager_instance, |
116 | finishNotification); | 114 | finishNotification); |
@@ -124,7 +122,6 @@ static void track_finished_callback(void *param) | |||
124 | 122 | ||
125 | void notification_init(void) | 123 | void notification_init(void) |
126 | { | 124 | { |
127 | JNIEnv *env_ptr = getJavaEnvironment(); | ||
128 | JNIEnv e = *env_ptr; | 125 | JNIEnv e = *env_ptr; |
129 | jfieldID nNM = e->GetFieldID(env_ptr, RockboxService_class, | 126 | jfieldID nNM = e->GetFieldID(env_ptr, RockboxService_class, |
130 | "fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;"); | 127 | "fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;"); |