MessageQueue: integrate with glib main loop

Adds a special treatment for the main Looper to not block in java code,
but instead return to glib managed thread loop. Timeouts in the mainloop
are now handled using g_timeout_add_full().

Also defer Activity construction, so that every thing is set up properly
when the constructor runs.
This commit is contained in:
Julian Winkler
2023-08-08 10:16:17 +02:00
parent c6c4e8b3a2
commit 4491de7f63
7 changed files with 80 additions and 29 deletions

View File

@@ -26,9 +26,9 @@ JNIEXPORT void JNICALL Java_android_os_MessageQueue_nativeDestroy
/*
* Class: android_os_MessageQueue
* Method: nativePollOnce
* Signature: (JI)V
* Signature: (JI)Z
*/
JNIEXPORT void JNICALL Java_android_os_MessageQueue_nativePollOnce
JNIEXPORT jboolean JNICALL Java_android_os_MessageQueue_nativePollOnce
(JNIEnv *, jclass, jlong, jint);
/*