Make android compile (untested)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29496 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-03-02 10:13:56 +00:00
parent d233066155
commit 86a0022a16
2 changed files with 8 additions and 8 deletions

View file

@ -31,7 +31,7 @@ extern JNIEnv *env_ptr;
static jclass RockboxKeyboardInput_class; static jclass RockboxKeyboardInput_class;
static jobject RockboxKeyboardInput_instance; static jobject RockboxKeyboardInput_instance;
static jmethodID kbd_inputfunc; static jmethodID kbd_inputfunc;
static struct wakeup kbd_wakeup; static struct semaphore kbd_wakeup;
static bool accepted; static bool accepted;
static jstring new_string; static jstring new_string;
@ -48,7 +48,7 @@ Java_org_rockbox_RockboxKeyboardInput_put_1result(JNIEnv *env, jobject this,
new_string = _new_string; new_string = _new_string;
(*env)->NewGlobalRef(env, new_string); /* prevet GC'ing */ (*env)->NewGlobalRef(env, new_string); /* prevet GC'ing */
} }
wakeup_signal(&kbd_wakeup); semaphore_release(&kbd_wakeup);
} }
static void kdb_init(void) static void kdb_init(void)
@ -57,7 +57,7 @@ static void kdb_init(void)
static jmethodID kbd_is_usable; static jmethodID kbd_is_usable;
if (RockboxKeyboardInput_class == NULL) if (RockboxKeyboardInput_class == NULL)
{ {
wakeup_init(&kbd_wakeup); semaphore_init(&kbd_wakeup, 1, 0);
/* get the class and its constructor */ /* get the class and its constructor */
RockboxKeyboardInput_class = e->FindClass(env_ptr, RockboxKeyboardInput_class = e->FindClass(env_ptr,
"org/rockbox/RockboxKeyboardInput"); "org/rockbox/RockboxKeyboardInput");
@ -94,7 +94,7 @@ int kbd_input(char* text, int buflen)
e->CallVoidMethod(env_ptr, RockboxKeyboardInput_instance,kbd_inputfunc, e->CallVoidMethod(env_ptr, RockboxKeyboardInput_instance,kbd_inputfunc,
str, ok_text, cancel_text); str, ok_text, cancel_text);
wakeup_wait(&kbd_wakeup, TIMEOUT_BLOCK); semaphore_wait(&kbd_wakeup, TIMEOUT_BLOCK);
if (accepted) if (accepted)
{ {

View file

@ -33,7 +33,7 @@ extern JNIEnv *env_ptr;
static jclass RockboxYesno_class = NULL; static jclass RockboxYesno_class = NULL;
static jobject RockboxYesno_instance = NULL; static jobject RockboxYesno_instance = NULL;
static jmethodID yesno_func; static jmethodID yesno_func;
static struct wakeup yesno_wakeup; static struct semaphore yesno_done;
static bool ret; static bool ret;
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
@ -42,7 +42,7 @@ Java_org_rockbox_RockboxYesno_put_1result(JNIEnv *env, jobject this, jboolean re
(void)env; (void)env;
(void)this; (void)this;
ret = (bool)result; ret = (bool)result;
wakeup_signal(&yesno_wakeup); semaphore_release(&yesno_done);
} }
static void yesno_init(void) static void yesno_init(void)
@ -51,7 +51,7 @@ static void yesno_init(void)
static jmethodID yesno_is_usable; static jmethodID yesno_is_usable;
if (RockboxYesno_class == NULL) if (RockboxYesno_class == NULL)
{ {
wakeup_init(&yesno_wakeup); semaphore_init(&yesno_done, 1, 0);
/* get the class and its constructor */ /* get the class and its constructor */
RockboxYesno_class = e->FindClass(env_ptr, RockboxYesno_class = e->FindClass(env_ptr,
"org/rockbox/RockboxYesno"); "org/rockbox/RockboxYesno");
@ -109,7 +109,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func, e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func,
message, yes, no); message, yes, no);
wakeup_wait(&yesno_wakeup, TIMEOUT_BLOCK); semaphore_wait(&yesno_done, TIMEOUT_BLOCK);
e->DeleteLocalRef(env_ptr, message); e->DeleteLocalRef(env_ptr, message);
e->DeleteLocalRef(env_ptr, yes); e->DeleteLocalRef(env_ptr, yes);