Add new events and accompanying logic to notify when the app is paused and resumed on Android devices.

This commit is contained in:
fhuya 2019-09-09 14:42:17 -07:00
parent 2add51d082
commit a7712cc9e4
12 changed files with 123 additions and 29 deletions

View file

@ -1387,3 +1387,21 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResu
AudioDriver::get_singleton()->capture_start();
}
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNIEnv *env, jclass clazz) {
if (step == 0)
return;
if (os_android->get_main_loop()) {
os_android->get_main_loop()->notification(MainLoop::NOTIFICATION_APP_RESUMED);
}
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererPaused(JNIEnv *env, jclass clazz) {
if (step == 0)
return;
if (os_android->get_main_loop()) {
os_android->get_main_loop()->notification(MainLoop::NOTIFICATION_APP_PAUSED);
}
}