You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
make Looper, Handler, and MessageQueue work properly
this for example makes Unity apps not steal the main thread, hanging Gtk.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "generated_headers/android_os_SystemClock.h"
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime(JNIEnv *env, jclass this)
|
||||
@@ -5,3 +8,10 @@ JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime(JNIEnv *env,
|
||||
printf("FIXME: Java_android_os_SystemClock_elapsedRealtime: returning 0\n");
|
||||
return 0; // FIXME
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_uptimeMillis(JNIEnv *env, jclass this)
|
||||
{
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return t.tv_sec * 1000 + lround(t.tv_nsec / 1e6);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user