diff options
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 9ef5af8c0c..d256f31ab5 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h | |||
@@ -82,6 +82,8 @@ | |||
82 | #define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 0) | 82 | #define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 0) |
83 | #define SYS_IAP_PERIODIC MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) | 83 | #define SYS_IAP_PERIODIC MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) |
84 | #define SYS_IAP_HANDLEPKT MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 2) | 84 | #define SYS_IAP_HANDLEPKT MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 2) |
85 | #define SYS_CALL_INCOMING MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 3) | ||
86 | #define SYS_CALL_HUNG_UP MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 4) | ||
85 | 87 | ||
86 | #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) | 88 | #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) |
87 | 89 | ||
diff --git a/firmware/target/hosted/android/kernel-android.c b/firmware/target/hosted/android/kernel-android.c index 1a9b97b419..636c849c24 100644 --- a/firmware/target/hosted/android/kernel-android.c +++ b/firmware/target/hosted/android/kernel-android.c | |||
@@ -23,14 +23,17 @@ | |||
23 | #include <jni.h> | 23 | #include <jni.h> |
24 | #include "config.h" | 24 | #include "config.h" |
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "button.h" | ||
27 | #include "audio.h" | ||
26 | 28 | ||
27 | extern JNIEnv *env_ptr; | 29 | extern JNIEnv *env_ptr; |
28 | 30 | ||
31 | extern jobject RockboxService_instance; | ||
32 | |||
29 | static jclass RockboxTimer_class; | 33 | static jclass RockboxTimer_class; |
30 | static jobject RockboxTimer_instance; | 34 | static jobject RockboxTimer_instance; |
31 | static jmethodID java_wait_for_interrupt; | 35 | static jmethodID java_wait_for_interrupt; |
32 | static bool initialized = false; | 36 | static bool initialized = false; |
33 | |||
34 | /* | 37 | /* |
35 | * This is called from the separate Timer java thread. I have not added any | 38 | * This is called from the separate Timer java thread. I have not added any |
36 | * interrupt simulation to it (like the sdl counterpart does), | 39 | * interrupt simulation to it (like the sdl counterpart does), |
@@ -49,6 +52,22 @@ Java_org_rockbox_RockboxTimer_timerTask(JNIEnv *env, jobject this) | |||
49 | call_tick_tasks(); | 52 | call_tick_tasks(); |
50 | } | 53 | } |
51 | 54 | ||
55 | JNIEXPORT void JNICALL | ||
56 | Java_org_rockbox_RockboxTimer_postCallIncoming(JNIEnv *env, jobject this) | ||
57 | { | ||
58 | (void)env; | ||
59 | (void)this; | ||
60 | queue_broadcast(SYS_CALL_INCOMING, 0); | ||
61 | } | ||
62 | |||
63 | JNIEXPORT void JNICALL | ||
64 | Java_org_rockbox_RockboxTimer_postCallHungUp(JNIEnv *env, jobject this) | ||
65 | { | ||
66 | (void)env; | ||
67 | (void)this; | ||
68 | queue_broadcast(SYS_CALL_HUNG_UP, 0); | ||
69 | } | ||
70 | |||
52 | void tick_start(unsigned int interval_in_ms) | 71 | void tick_start(unsigned int interval_in_ms) |
53 | { | 72 | { |
54 | JNIEnv e = *env_ptr; | 73 | JNIEnv e = *env_ptr; |
@@ -57,11 +76,12 @@ void tick_start(unsigned int interval_in_ms) | |||
57 | jmethodID constructor = e->GetMethodID(env_ptr, | 76 | jmethodID constructor = e->GetMethodID(env_ptr, |
58 | RockboxTimer_class, | 77 | RockboxTimer_class, |
59 | "<init>", | 78 | "<init>", |
60 | "(J)V"); | 79 | "(Lorg/rockbox/RockboxService;J)V"); |
61 | /* the constructor will do the tick_start */ | 80 | /* the constructor will do the tick_start */ |
62 | RockboxTimer_instance = e->NewObject(env_ptr, | 81 | RockboxTimer_instance = e->NewObject(env_ptr, |
63 | RockboxTimer_class, | 82 | RockboxTimer_class, |
64 | constructor, | 83 | constructor, |
84 | RockboxService_instance, | ||
65 | (jlong)interval_in_ms); | 85 | (jlong)interval_in_ms); |
66 | 86 | ||
67 | /* get our wfi func also */ | 87 | /* get our wfi func also */ |