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
misc stuff to make glmark2 run
This commit is contained in:
@@ -381,7 +381,6 @@ void Java_android_app_NativeActivity_onStartNative(JNIEnv* env, jobject clazz, j
|
||||
|
||||
void Java_android_app_NativeActivity_onResumeNative(JNIEnv* env, jobject clazz, jlong handle)
|
||||
{
|
||||
printf("STUB - onResume_native\n");
|
||||
if (handle != 0) {
|
||||
struct NativeCode* code = (struct NativeCode*)handle;
|
||||
if (code->callbacks.onResume != NULL) {
|
||||
@@ -418,24 +417,22 @@ jbyteArray Java_android_app_NativeActivity_onSaveInstanceStateNative(JNIEnv* env
|
||||
|
||||
void Java_android_app_NativeActivity_onPauseNative(JNIEnv* env, jobject clazz, jlong handle)
|
||||
{
|
||||
printf("STUB - onPause_native\n");
|
||||
/* if (handle != 0) {
|
||||
if (handle != 0) {
|
||||
struct NativeCode* code = (struct NativeCode*)handle;
|
||||
if (code->callbacks.onPause != NULL) {
|
||||
code->callbacks.onPause((ANativeActivity *)code);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void Java_android_app_NativeActivity_onStopNative(JNIEnv* env, jobject clazz, jlong handle)
|
||||
{
|
||||
printf("STUB - onStop_native\n");
|
||||
/* if (handle != 0) {
|
||||
if (handle != 0) {
|
||||
struct NativeCode* code = (struct NativeCode*)handle;
|
||||
if (code->callbacks.onStop != NULL) {
|
||||
code->callbacks.onStop((ANativeActivity *)code);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void Java_android_app_NativeActivity_onConfigurationChangedNative(JNIEnv* env, jobject clazz, jlong handle)
|
||||
|
||||
@@ -28,9 +28,11 @@ static void activity_close(JNIEnv *env, jobject activity)
|
||||
|
||||
static void activity_unfocus(JNIEnv *env, jobject activity)
|
||||
{
|
||||
(*env)->CallVoidMethod(env, activity, handle_cache.activity.onPause);
|
||||
if((*env)->ExceptionCheck(env))
|
||||
(*env)->ExceptionDescribe(env);
|
||||
if(!_GET_BOOL_FIELD(activity, "paused")) {
|
||||
(*env)->CallVoidMethod(env, activity, handle_cache.activity.onPause);
|
||||
if((*env)->ExceptionCheck(env))
|
||||
(*env)->ExceptionDescribe(env);
|
||||
}
|
||||
|
||||
(*env)->CallVoidMethod(env, activity, handle_cache.activity.onStop);
|
||||
if((*env)->ExceptionCheck(env))
|
||||
|
||||
@@ -27,10 +27,12 @@
|
||||
#define _SET_LONG_FIELD(object, field, value) ((*env)->SetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J"), value))
|
||||
#define _GET_LONG_FIELD(object, field) ((*env)->GetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J")))
|
||||
#define _SET_INT_FIELD(object, field, value) ((*env)->SetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I"), value))
|
||||
#define _GET_INT_FIELD(object, field) ((*env)->GetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I")))
|
||||
#define _SET_BOOL_FIELD(object, field, value) ((*env)->SetBooleanField(env, object, _FIELD_ID(_CLASS(object), field, "Z"), value))
|
||||
#define _GET_BOOL_FIELD(object, field) ((*env)->GetBooleanField(env, object, _FIELD_ID(_CLASS(object), field, "Z")))
|
||||
#define _SET_STATIC_INT_FIELD(class, field, value) ((*env)->SetStaticIntField(env, class, _STATIC_FIELD_ID(class, field, "I"), value))
|
||||
#define _SET_STATIC_OBJ_FIELD(class, field, type, value) ((*env)->SetStaticObjectField(env, class, _STATIC_FIELD_ID(class, field, type), value))
|
||||
#define _GET_STATIC_OBJ_FIELD(class, field, type) ((*env)->GetStaticObjectField(env, class, _STATIC_FIELD_ID(class, field, type)))
|
||||
#define _GET_INT_FIELD(object, field) ((*env)->GetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I")))
|
||||
#define _GET_BYTE_ARRAY_ELEMENTS(b_array) ((*env)->GetByteArrayElements(env, b_array, NULL))
|
||||
#define _RELEASE_BYTE_ARRAY_ELEMENTS(b_array, buffer_ptr) ((*env)->ReleaseByteArrayElements(env, b_array, buffer_ptr, 0))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user