diff --git a/android/native/jni/input_android.c b/android/native/jni/input_android.c index b91fea007e..a23f13e85e 100644 --- a/android/native/jni/input_android.c +++ b/android/native/jni/input_android.c @@ -347,6 +347,20 @@ void engine_handle_input(void) } } +// Handle all events. If our activity is in pause state, block until we're unpaused. +void android_handle_events(void) +{ + int ident; + while ((ident = ALooper_pollAll((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ? -1 : 0, + NULL, NULL, NULL)) >= 0) + { + if (ident == LOOPER_ID_MAIN) + engine_handle_cmd(); + else if (!input_key_pressed_func(RARCH_PAUSE_TOGGLE)) + engine_handle_input(); + } +} + static void *android_input_init(void) { pads_connected = 0; diff --git a/frontend/frontend_android.c b/frontend/frontend_android.c index e761319988..6c7e39ba12 100644 --- a/frontend/frontend_android.c +++ b/frontend/frontend_android.c @@ -176,20 +176,6 @@ static bool android_app_start_main(struct android_app *android_app, int *init_re } } -// Handle all events. If our activity is in pause state, block until we're unpaused. -static void android_handle_events(void) -{ - int ident; - while ((ident = ALooper_pollAll((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ? -1 : 0, - NULL, NULL, NULL)) >= 0) - { - if (ident == LOOPER_ID_MAIN) - engine_handle_cmd(); - else if (!input_key_pressed_func(RARCH_PAUSE_TOGGLE)) - engine_handle_input(); - } -} - static void *android_app_entry(void *data) { struct android_app* android_app = (struct android_app*)data; diff --git a/frontend/frontend_android.h b/frontend/frontend_android.h index 6592f5b85d..71d87e237c 100644 --- a/frontend/frontend_android.h +++ b/frontend/frontend_android.h @@ -156,6 +156,7 @@ enum { int8_t android_app_read_cmd (void *data); extern void engine_app_read_cmd(void); extern void engine_handle_cmd(void); +extern void android_handle_events(void); extern struct android_app *g_android;