summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/android/kernel-android.c24
1 files changed, 22 insertions, 2 deletions
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
27extern JNIEnv *env_ptr; 29extern JNIEnv *env_ptr;
28 30
31extern jobject RockboxService_instance;
32
29static jclass RockboxTimer_class; 33static jclass RockboxTimer_class;
30static jobject RockboxTimer_instance; 34static jobject RockboxTimer_instance;
31static jmethodID java_wait_for_interrupt; 35static jmethodID java_wait_for_interrupt;
32static bool initialized = false; 36static 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
55JNIEXPORT void JNICALL
56Java_org_rockbox_RockboxTimer_postCallIncoming(JNIEnv *env, jobject this)
57{
58 (void)env;
59 (void)this;
60 queue_broadcast(SYS_CALL_INCOMING, 0);
61}
62
63JNIEXPORT void JNICALL
64Java_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
52void tick_start(unsigned int interval_in_ms) 71void 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 */