summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/android/telephony-android.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/telephony-android.c')
-rw-r--r--firmware/target/hosted/android/telephony-android.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/target/hosted/android/telephony-android.c b/firmware/target/hosted/android/telephony-android.c
index df89a56e14..63f0f05e39 100644
--- a/firmware/target/hosted/android/telephony-android.c
+++ b/firmware/target/hosted/android/telephony-android.c
@@ -21,11 +21,15 @@
#include <jni.h>
+#include "system.h"
#include "kernel.h"
extern JNIEnv *env_ptr;
extern jobject RockboxService_instance;
+/* telephony_init_device() is currently called in system_init(). Thus, there is
+ * a small chance of the callbacks (and queue_broadcast) being called before
+ * the kernel is initialized (this happens after system_init(). */
void telephony_init_device(void)
{
@@ -44,7 +48,8 @@ Java_org_rockbox_monitors_TelephonyMonitor_postCallIncoming(JNIEnv *env, jobject
{
(void)env;
(void)this;
- queue_broadcast(SYS_CALL_INCOMING, 0);
+ if (is_rockbox_ready())
+ queue_broadcast(SYS_CALL_INCOMING, 0);
}
JNIEXPORT void JNICALL
@@ -52,5 +57,6 @@ Java_org_rockbox_monitors_TelephonyMonitor_postCallHungUp(JNIEnv *env, jobject t
{
(void)env;
(void)this;
- queue_broadcast(SYS_CALL_HUNG_UP, 0);
+ if (is_rockbox_ready())
+ queue_broadcast(SYS_CALL_HUNG_UP, 0);
}