summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 19:38:30 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2011-03-11 19:38:30 +0000
commit0b18522cd09921995d130bd451d8288162ea68d9 (patch)
treec783f4eceef658329e75ef1369d697d436a0a4db /firmware/target/hosted
parent80a2c803327f60bd81e847a8f1557d516e0a721a (diff)
downloadrockbox-0b18522cd09921995d130bd451d8288162ea68d9.tar.gz
rockbox-0b18522cd09921995d130bd451d8288162ea68d9.zip
Android: delete the global reference in surfaceDestroyed
This gets rid of the lcd_deinit() boilerplate. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29572 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted')
-rw-r--r--firmware/target/hosted/android/lcd-android.c12
-rw-r--r--firmware/target/hosted/android/system-android.c7
2 files changed, 5 insertions, 14 deletions
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c
index f9d7917a5e..b1d27280b0 100644
--- a/firmware/target/hosted/android/lcd-android.c
+++ b/firmware/target/hosted/android/lcd-android.c
@@ -87,13 +87,6 @@ void connect_with_java(JNIEnv* env, jobject fb_instance)
(jint)LCD_WIDTH, (jint)LCD_HEIGHT, native_buffer);
}
-void lcd_deinit(void)
-{
- JNIEnv *env_ptr = getJavaEnvironment();
-
- (*env_ptr)->DeleteGlobalRef(env_ptr, RockboxFramebuffer_instance);
-}
-
/*
* Do nothing here and connect with the java object later (if it isn't already)
*/
@@ -148,9 +141,12 @@ JNIEXPORT void JNICALL
Java_org_rockbox_RockboxFramebuffer_surfaceDestroyed(JNIEnv *e, jobject this,
jobject surfaceholder)
{
- (void)e; (void)this; (void)surfaceholder;
+ (void)this; (void)surfaceholder;
display_on = false;
+
+ (*e)->DeleteGlobalRef(e, RockboxFramebuffer_instance);
+ RockboxFramebuffer_instance = NULL;
}
bool lcd_active(void)
diff --git a/firmware/target/hosted/android/system-android.c b/firmware/target/hosted/android/system-android.c
index c499631132..8d36198c61 100644
--- a/firmware/target/hosted/android/system-android.c
+++ b/firmware/target/hosted/android/system-android.c
@@ -36,15 +36,10 @@ uintptr_t *stackend;
extern int main(void);
extern void telephony_init_device(void);
-extern void lcd_deinit(void);
void system_exception_wait(void) { }
void system_reboot(void) { }
-
-void power_off(void)
-{
- lcd_deinit();
-}
+void power_off(void) { }
void system_init(void)
{