diff options
Diffstat (limited to 'firmware/target/hosted/android/telephony-android.c')
-rw-r--r-- | firmware/target/hosted/android/telephony-android.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/telephony-android.c b/firmware/target/hosted/android/telephony-android.c new file mode 100644 index 0000000000..771b7a973a --- /dev/null +++ b/firmware/target/hosted/android/telephony-android.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | |||
23 | #include <jni.h> | ||
24 | #include "kernel.h" | ||
25 | |||
26 | extern JNIEnv *env_ptr; | ||
27 | extern RockboxService_instance; | ||
28 | |||
29 | |||
30 | void telephony_init_device(void) | ||
31 | { | ||
32 | JNIEnv e = *env_ptr; | ||
33 | jclass class = e->FindClass(env_ptr, "org/rockbox/RockboxTelephony"); | ||
34 | jmethodID constructor = e->GetMethodID(env_ptr, class, "<init>", "(Landroid/content/Context;)V"); | ||
35 | |||
36 | e->NewObject(env_ptr, class, constructor, RockboxService_instance); | ||
37 | } | ||
38 | |||
39 | |||
40 | JNIEXPORT void JNICALL | ||
41 | Java_org_rockbox_RockboxTelephony_postCallIncoming(JNIEnv *env, jobject this) | ||
42 | { | ||
43 | (void)env; | ||
44 | (void)this; | ||
45 | queue_broadcast(SYS_CALL_INCOMING, 0); | ||
46 | } | ||
47 | |||
48 | JNIEXPORT void JNICALL | ||
49 | Java_org_rockbox_RockboxTelephony_postCallHungUp(JNIEnv *env, jobject this) | ||
50 | { | ||
51 | (void)env; | ||
52 | (void)this; | ||
53 | queue_broadcast(SYS_CALL_HUNG_UP, 0); | ||
54 | } | ||