diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2011-02-23 01:10:54 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2011-02-23 01:10:54 +0000 |
| commit | 95e24dd7a54256e8df56e347c0f43133087a1df2 (patch) | |
| tree | 677d66d4e72fedfe134bca103ed98b5792da1440 /firmware/target/hosted/android/button-android.c | |
| parent | da3417706d927c7da0b59351fa8cc010d63d7928 (diff) | |
| download | rockbox-95e24dd7a54256e8df56e347c0f43133087a1df2.zip rockbox-95e24dd7a54256e8df56e347c0f43133087a1df2.tar.gz rockbox-95e24dd7a54256e8df56e347c0f43133087a1df2.tar.bz2 rockbox-95e24dd7a54256e8df56e347c0f43133087a1df2.tar.xz | |
Android:
* Re-create RockboxFramebuffer instance with every time there's a new Activity.
* Also, allow Rockbox to be started via multimedia buttons, immediately starting playback if wanted.
We don't need to keep the fb instance around when it backround, and it makes us less depending on it and the activity (less race conditions). And this is how you usually do it in Android apps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29384 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/hosted/android/button-android.c')
| -rw-r--r-- | firmware/target/hosted/android/button-android.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/hosted/android/button-android.c b/firmware/target/hosted/android/button-android.c index 832eef5..ed1e125 100644 --- a/firmware/target/hosted/android/button-android.c +++ b/firmware/target/hosted/android/button-android.c @@ -29,6 +29,7 @@ #include "system.h" #include "touchscreen.h" +extern JNIEnv *env_ptr; static int last_y, last_x; static int last_btns; @@ -61,11 +62,11 @@ Java_org_rockbox_RockboxFramebuffer_touchHandler(JNIEnv*env, jobject this, * this writes in an interrupt-like fashion the button events that the user * generated by pressing/releasing them to a variable */ JNIEXPORT bool JNICALL -Java_org_rockbox_RockboxFramebuffer_buttonHandler(JNIEnv*env, jclass this, +Java_org_rockbox_RockboxFramebuffer_buttonHandler(JNIEnv*env, jclass class, jint keycode, jboolean state) { (void)env; - (void)this; + (void)class; unsigned button = 0; @@ -75,7 +76,10 @@ Java_org_rockbox_RockboxFramebuffer_buttonHandler(JNIEnv*env, jclass this, if (!button) button = dpad_to_button((int)keycode); if (button) + { queue_post(&button_queue, button, 0); + return true; + } } if (!button) |