forked from len0rd/rockbox
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
This commit is contained in:
parent
bb56bc4ba0
commit
0cf2cc1607
7 changed files with 174 additions and 56 deletions
|
@ -24,10 +24,6 @@
|
|||
#include "config.h"
|
||||
#include "system.h"
|
||||
|
||||
void system_exception_wait(void) { }
|
||||
void system_reboot(void) { }
|
||||
void power_off(void) { }
|
||||
void system_init(void) { }
|
||||
|
||||
|
||||
/* global fields for use with various JNI calls */
|
||||
|
@ -40,6 +36,21 @@ uintptr_t *stackend;
|
|||
|
||||
extern int main(void);
|
||||
extern void powermgmt_init_target(void);
|
||||
extern void telephony_init_device(void);
|
||||
|
||||
void system_exception_wait(void) { }
|
||||
void system_reboot(void) { }
|
||||
void power_off(void) { }
|
||||
|
||||
void system_init(void)
|
||||
{
|
||||
/* no better place yet, most of powermgmt.c is #ifdef'd out for non-native
|
||||
* builds */
|
||||
powermgmt_init_target();
|
||||
/* also no better place yet */
|
||||
telephony_init_device();
|
||||
}
|
||||
|
||||
/* this is the entry point of the android app initially called by jni */
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_rockbox_RockboxService_main(JNIEnv *env, jobject this)
|
||||
|
@ -57,8 +68,5 @@ Java_org_rockbox_RockboxService_main(JNIEnv *env, jobject this)
|
|||
RockboxService_instance = this;
|
||||
RockboxService_class = (*env)->GetObjectClass(env, this);
|
||||
|
||||
/* no better place yet, most of powermgmt.c is #ifdef'd out for non-native
|
||||
* builds */
|
||||
powermgmt_init_target();
|
||||
main();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue