diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2010-08-07 21:30:22 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2010-08-07 21:30:22 +0000 |
| commit | ca4439ff65bdc93fc44f4cc1be52aab50217ce78 (patch) | |
| tree | 06578c5243a9c7b0c4c5dcb322ffb9a4609b5e7a /firmware | |
| parent | f1184f963aea4cb16a5886c71cc662a0503e1cd5 (diff) | |
| download | rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.zip rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.gz rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.bz2 rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.xz | |
Android port: handle incoming calls.
Stop explicitely if a call comes in, and resume playback (if it was playing before the call) upon hang up.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27746 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/export/kernel.h | 2 | ||||
| -rw-r--r-- | firmware/target/hosted/android/kernel-android.c | 24 |
2 files changed, 24 insertions, 2 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 9ef5af8..d256f31 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -82,6 +82,8 @@ #define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 0) #define SYS_IAP_PERIODIC MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) #define SYS_IAP_HANDLEPKT MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 2) +#define SYS_CALL_INCOMING MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 3) +#define SYS_CALL_HUNG_UP MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 4) #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) diff --git a/firmware/target/hosted/android/kernel-android.c b/firmware/target/hosted/android/kernel-android.c index 1a9b97b..636c849 100644 --- a/firmware/target/hosted/android/kernel-android.c +++ b/firmware/target/hosted/android/kernel-android.c @@ -23,14 +23,17 @@ #include <jni.h> #include "config.h" #include "system.h" +#include "button.h" +#include "audio.h" extern JNIEnv *env_ptr; +extern jobject RockboxService_instance; + static jclass RockboxTimer_class; static jobject RockboxTimer_instance; static jmethodID java_wait_for_interrupt; static bool initialized = false; - /* * This is called from the separate Timer java thread. I have not added any * interrupt simulation to it (like the sdl counterpart does), @@ -49,6 +52,22 @@ Java_org_rockbox_RockboxTimer_timerTask(JNIEnv *env, jobject this) call_tick_tasks(); } +JNIEXPORT void JNICALL +Java_org_rockbox_RockboxTimer_postCallIncoming(JNIEnv *env, jobject this) +{ + (void)env; + (void)this; + queue_broadcast(SYS_CALL_INCOMING, 0); +} + +JNIEXPORT void JNICALL +Java_org_rockbox_RockboxTimer_postCallHungUp(JNIEnv *env, jobject this) +{ + (void)env; + (void)this; + queue_broadcast(SYS_CALL_HUNG_UP, 0); +} + void tick_start(unsigned int interval_in_ms) { JNIEnv e = *env_ptr; @@ -57,11 +76,12 @@ void tick_start(unsigned int interval_in_ms) jmethodID constructor = e->GetMethodID(env_ptr, RockboxTimer_class, "<init>", - "(J)V"); + "(Lorg/rockbox/RockboxService;J)V"); /* the constructor will do the tick_start */ RockboxTimer_instance = e->NewObject(env_ptr, RockboxTimer_class, constructor, + RockboxService_instance, (jlong)interval_in_ms); /* get our wfi func also */ |