summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/lcd-android.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/lcd-android.c')
-rw-r--r--firmware/target/hosted/android/lcd-android.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c
index 08a4075795..66ddcd5e3e 100644
--- a/firmware/target/hosted/android/lcd-android.c
+++ b/firmware/target/hosted/android/lcd-android.c
@@ -28,7 +28,6 @@
28#include "lcd.h" 28#include "lcd.h"
29#include "button.h" 29#include "button.h"
30 30
31extern JNIEnv *env_ptr;
32extern jobject RockboxService_instance; 31extern jobject RockboxService_instance;
33 32
34static jobject RockboxFramebuffer_instance; 33static jobject RockboxFramebuffer_instance;
@@ -94,6 +93,8 @@ void connect_with_java(JNIEnv* env, jobject fb_instance)
94 93
95void lcd_deinit(void) 94void lcd_deinit(void)
96{ 95{
96 JNIEnv *env_ptr = getJavaEnvironment();
97
97 (*env_ptr)->DeleteGlobalRef(env_ptr, RockboxFramebuffer_instance); 98 (*env_ptr)->DeleteGlobalRef(env_ptr, RockboxFramebuffer_instance);
98 (*env_ptr)->DeleteGlobalRef(env_ptr, native_buffer); 99 (*env_ptr)->DeleteGlobalRef(env_ptr, native_buffer);
99} 100}
@@ -107,6 +108,8 @@ void lcd_init_device(void)
107 108
108void lcd_update(void) 109void lcd_update(void)
109{ 110{
111 JNIEnv *env_ptr = getJavaEnvironment();
112
110 if (display_on) 113 if (display_on)
111 (*env_ptr)->CallVoidMethod(env_ptr, RockboxFramebuffer_instance, 114 (*env_ptr)->CallVoidMethod(env_ptr, RockboxFramebuffer_instance,
112 java_lcd_update); 115 java_lcd_update);
@@ -114,6 +117,8 @@ void lcd_update(void)
114 117
115void lcd_update_rect(int x, int y, int width, int height) 118void lcd_update_rect(int x, int y, int width, int height)
116{ 119{
120 JNIEnv *env_ptr = getJavaEnvironment();
121
117 if (display_on) 122 if (display_on)
118 (*env_ptr)->CallVoidMethod(env_ptr, RockboxFramebuffer_instance, 123 (*env_ptr)->CallVoidMethod(env_ptr, RockboxFramebuffer_instance,
119 java_lcd_update_rect, x, y, width, height); 124 java_lcd_update_rect, x, y, width, height);