diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-03-22 20:35:57 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-03-22 20:44:52 +0100 |
commit | 58e097d4a6c64bf762a8c30e24f16cc62c574519 (patch) | |
tree | 16f8135f9ced2e8cd815ff68024b6ef3f237e388 /firmware/target/hosted/android/lcd-android.c | |
parent | b0df3233917c51049a380f04b909f061de828972 (diff) | |
download | rockbox-58e097d4a6c64bf762a8c30e24f16cc62c574519.tar.gz rockbox-58e097d4a6c64bf762a8c30e24f16cc62c574519.zip |
android: Add facility for java code to wait native code to be ready.
Especially when unzipping rockbox.zip, the native code can be initialized
a lot later than the java code. The java code needs to be prevented from
accessing rockbox structures (e.g. current_tick, event queues) before they're
ready.
This commit adds wait_rockbox_ready() and fixes dodgy behavior of starting
rockbox via widget play button, headset remote buttons or multimedia keys.
Also fixes wrong small list items before first redraw.
Change-Id: I1caf925e829a9c1c6bb6e0016d5c80574574c91e
Diffstat (limited to 'firmware/target/hosted/android/lcd-android.c')
-rw-r--r-- | firmware/target/hosted/android/lcd-android.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c index 4e4ea66268..15c844bbd6 100644 --- a/firmware/target/hosted/android/lcd-android.c +++ b/firmware/target/hosted/android/lcd-android.c | |||
@@ -122,6 +122,9 @@ Java_org_rockbox_RockboxFramebuffer_surfaceCreated(JNIEnv *env, jobject this, | |||
122 | connect_with_java(env, this); | 122 | connect_with_java(env, this); |
123 | display_on = true; | 123 | display_on = true; |
124 | 124 | ||
125 | /* need to wait for button_queue to be valid to post to */ | ||
126 | wait_rockbox_ready(); | ||
127 | |||
125 | send_event(LCD_EVENT_ACTIVATION, NULL); | 128 | send_event(LCD_EVENT_ACTIVATION, NULL); |
126 | /* Force an update, since the newly created surface is initially black | 129 | /* Force an update, since the newly created surface is initially black |
127 | * waiting for the next normal update results in a longish black screen */ | 130 | * waiting for the next normal update results in a longish black screen */ |