diff --git a/android/native/jni/android_general.h b/android/native/jni/android_general.h index 8a4ba73d8d..5edd3051cd 100644 --- a/android/native/jni/android_general.h +++ b/android/native/jni/android_general.h @@ -34,7 +34,6 @@ struct droid unsigned height; struct saved_state state; int32_t last_orient; - unsigned activity_paused; float disp_refresh_rate; }; diff --git a/android/native/jni/main.c b/android/native/jni/main.c index 9d4025f2e6..53acc4d998 100644 --- a/android/native/jni/main.c +++ b/android/native/jni/main.c @@ -163,8 +163,7 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd) /* POSTEXEC */ free_saved_state(android_app); - g_android.activity_paused = false; - + g_extern.lifecycle_state &= ~(1ULL << RARCH_PAUSE_TOGGLE); break; case APP_CMD_START: RARCH_LOG("engine_handle_cmd: APP_CMD_START.\n"); @@ -191,7 +190,7 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd) /* Setting reentrancy */ RARCH_LOG("Setting up RetroArch re-entrancy...\n"); g_extern.lifecycle_state |= (1ULL << RARCH_REENTRANT); - g_android.activity_paused = true; + g_extern.lifecycle_state |= (1ULL << RARCH_PAUSE_TOGGLE); } break; case APP_CMD_STOP: @@ -260,7 +259,7 @@ bool android_run_events(struct android_app* android_app) RARCH_LOG("RetroArch Android paused.\n"); // Block forever waiting for events. - while ((id = ALooper_pollOnce(g_android.activity_paused ? -1 : 100, NULL, 0, NULL)) >= 0) + while ((id = ALooper_pollOnce(input_key_pressed_func(RARCH_PAUSE_TOGGLE) ? -1 : 100, NULL, 0, NULL)) >= 0) { // Process this event. if (id) diff --git a/retroarch.c b/retroarch.c index d5c06f221e..7529fa48e4 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2776,7 +2776,7 @@ bool rarch_main_iterate(void) } #ifdef ANDROID - if (g_android.activity_paused) + if (input_key_pressed_func(RARCH_PAUSE_TOGGLE)) return android_run_events(g_android.app); #endif