From 0cf2cc1607a0844e906042173815451cd9c2ff58 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 12 Nov 2010 21:04:13 +0000 Subject: Android: Change how detecting call state (introduced in r27746) works, from polling to event based. * For some reason, the polling methid is much more inefficient than I thought. According to htop it caused up to 15% CPU load on some phones (e.g. Galaxy S). The event based causes no CPU load. Rockbox' idle CPU load is now back to 0%, while it was previously dominated by polling the call state. * Also stop on outgoing calls (no need to explicitely pause for making a call anymore). * Factor out the detection mechanism to separate files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28564 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/hosted/android/kernel-android.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'firmware/target/hosted/android/kernel-android.c') diff --git a/firmware/target/hosted/android/kernel-android.c b/firmware/target/hosted/android/kernel-android.c index 636c849..c0d927d 100644 --- a/firmware/target/hosted/android/kernel-android.c +++ b/firmware/target/hosted/android/kernel-android.c @@ -52,22 +52,6 @@ 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; @@ -76,7 +60,7 @@ void tick_start(unsigned int interval_in_ms) jmethodID constructor = e->GetMethodID(env_ptr, RockboxTimer_class, "", - "(Lorg/rockbox/RockboxService;J)V"); + "(Landroid/content/Context;J)V"); /* the constructor will do the tick_start */ RockboxTimer_instance = e->NewObject(env_ptr, RockboxTimer_class, -- cgit v1.1