summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/android/powermgmt-android.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 /firmware/target/hosted/android/powermgmt-android.c
parentefa9f13500d1672d0b631520e92e08f3ff61e45c (diff)
downloadrockbox-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 'firmware/target/hosted/android/powermgmt-android.c')
-rw-r--r--firmware/target/hosted/android/powermgmt-android.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/firmware/target/hosted/android/powermgmt-android.c b/firmware/target/hosted/android/powermgmt-android.c
index 222212f9c8..d23fece39a 100644
--- a/firmware/target/hosted/android/powermgmt-android.c
+++ b/firmware/target/hosted/android/powermgmt-android.c
@@ -23,8 +23,8 @@
#include <jni.h>
#include <stdbool.h>
#include "config.h"
-#include "system.h"
+extern JNIEnv *env_ptr;
extern jclass RockboxService_class;
extern jobject RockboxService_instance;
@@ -32,8 +32,6 @@ static jfieldID _battery_level;
void powermgmt_init_target(void)
{
- JNIEnv *env_ptr = getJavaEnvironment();
-
jmethodID initBatteryMonitor = (*env_ptr)->GetMethodID(env_ptr,
RockboxService_class,
"initBatteryMonitor",
@@ -52,8 +50,6 @@ void powermgmt_init_target(void)
int battery_level(void)
{
- JNIEnv *env_ptr = getJavaEnvironment();
-
return (*env_ptr)->GetIntField(env_ptr, RockboxService_instance, _battery_level);
}