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 Update all outdated online documentation links 2023-01-14 19:38:00 +03:00
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 Add InputEventKey.location to tell left from right 2024-01-26 14:42:28 +01:00
android_keys_utils.h Add InputEventKey.location to tell left from right 2024-01-26 14:42:28 +01:00
audio_driver_opensl.cpp Fix issue causing the Android editor to crash when creating a new AudioStreamMicrophone 2023-05-31 00:58:27 -07:00
audio_driver_opensl.h Further refactoring to AudioDriver implementations after #69120. 2023-02-09 11:02:00 +01:00
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 Style: Harmonize header includes in platform ports 2023-06-08 15:19:19 +02:00
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 Codestyle: Fix some comment issues 2023-11-21 15:26:53 +01:00
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 One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
jni_utils.h Style: Harmonize header includes in platform ports 2023-06-08 15:19:19 +02:00
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 One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
platform_gl.h [macOS/Windows] Add optional ANGLE backed OpenGL renderer support. Add EGL_ANDROID_blob_cache caching. 2023-09-21 14:21:00 +03:00
rendering_context_driver_vulkan_android.cpp Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
rendering_context_driver_vulkan_android.h Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
string_android.h Style: Harmonize header includes in platform ports 2023-06-08 15:19:19 +02:00
thread_jandroid.cpp Style: Harmonize header includes in platform ports 2023-06-08 15:19:19 +02:00
thread_jandroid.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
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.