summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/kernel.h2
-rw-r--r--firmware/target/hosted/android/kernel-android.c24
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 @@
#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 1a9b97b419..636c849c24 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 */