godot/platform/android
Fredia Huya-Kouadio 4d0da74014 Fix the cleanup logic for the Android render thread
On Android the exit logic goes through `Godot#onDestroy()` who attempts to cleanup the engine using the following code:

```
runOnRenderThread {
	GodotLib.ondestroy()
	forceQuit()
}
```

The issue however is that by the time we ran this code, the render thread has already been paused (but not yet destroyed), and thus `GodotLib.ondestroy()` and `forceQuit()` which are scheduled on the render thread are not executed.

To address this, we instead explicitly request the render thread to exit and block until it does. As part of it exit logic, the render thread has been updated to properly destroy and clean the native instance of the Godot engine, resolving the issue.
2024-07-24 10:17:46 -07:00
..
api Remove the limit on the number of the SignalInfo function parameters 2024-06-05 09:21:30 +08:00
doc_classes Standardize descriptions, add urls, remove deprecated tag from non-deprecated permission 2024-04-11 20:23:03 +01:00
export Fix issue preventing enabling the remote button for Android 2024-07-16 00:25:16 -07:00
java Fix the cleanup logic for the Android render thread 2024-07-24 10:17:46 -07:00
plugin Add logic to unregister the Godot plugins on engine termination 2024-05-19 19:27:04 -07:00
README.md
SCsub Update pre-commit hooks configuration to use `ruff` instead of `black` 2024-05-21 18:02:29 -05:00
android_input_handler.cpp Input logic cleanup: 2024-05-19 14:08:01 -07:00
android_input_handler.h Input logic cleanup: 2024-05-19 14:08:01 -07:00
android_keys_utils.cpp
android_keys_utils.h
audio_driver_opensl.cpp
audio_driver_opensl.h
detect.py Disable FP contraction. 2024-07-23 14:33:51 +03:00
dir_access_jandroid.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
dir_access_jandroid.h Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
display_server_android.cpp Cleanup Android input on render thread settings 2024-07-09 09:15:18 -07:00
display_server_android.h Properly set window class in Wayland 2024-05-22 10:42:12 -03:00
file_access_android.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
file_access_android.h Merge pull request #90710 from m4gr3d/fix_jstring_leaks 2024-04-22 12:52:16 +02:00
file_access_filesystem_jandroid.cpp Cleanup Android file errors 2024-04-22 07:48:45 -07:00
file_access_filesystem_jandroid.h Merge pull request #90710 from m4gr3d/fix_jstring_leaks 2024-04-22 12:52:16 +02:00
java_class_wrapper.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
java_godot_io_wrapper.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
java_godot_io_wrapper.h
java_godot_lib_jni.cpp Fix the cleanup logic for the Android render thread 2024-07-24 10:17:46 -07:00
java_godot_lib_jni.h Cleanup Android input on render thread settings 2024-07-09 09:15:18 -07:00
java_godot_view_wrapper.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
java_godot_view_wrapper.h
java_godot_wrapper.cpp Fix the cleanup logic for the Android render thread 2024-07-24 10:17:46 -07:00
java_godot_wrapper.h Fix the cleanup logic for the Android render thread 2024-07-24 10:17:46 -07:00
jni_utils.cpp
jni_utils.h
net_socket_android.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
net_socket_android.h Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
os_android.cpp Replace `find` with `contains/has` where applicable 2024-05-08 12:37:42 +02:00
os_android.h Implement `amplitude` to Input.vibrate_handheld 2024-05-02 19:09:42 +03:00
platform_config.h
platform_gl.h
rendering_context_driver_vulkan_android.cpp
rendering_context_driver_vulkan_android.h
string_android.h
thread_jandroid.cpp
thread_jandroid.h
tts_android.cpp Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00
tts_android.h Fix leakage of JNI object references 2024-04-15 10:30:18 -07:00

README.md

Android platform port

This folder contains the Java and C++ (JNI) code for the Android platform port, using Gradle as a build system.

Documentation

Artwork license

logo.png and run_icon.png are licensed under Creative Commons Attribution 3.0 Unported per the Android logo usage guidelines:

The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.