| 6 | extern EGLSurface g_EglSurface; |
| 7 | |
| 8 | float funcDeviceScale() |
| 9 | { |
| 10 | JavaVM* java_vm = g_App->activity->vm; |
| 11 | JNIEnv* java_env = NULL; |
| 12 | |
| 13 | jint jni_return = java_vm->GetEnv((void**)&java_env, JNI_VERSION_1_6); |
| 14 | if (jni_return == JNI_ERR) |
| 15 | throw satdump_exception("Could not get JNI environement"); |
| 16 | |
| 17 | jni_return = java_vm->AttachCurrentThread(&java_env, NULL); |
| 18 | if (jni_return != JNI_OK) |
| 19 | throw satdump_exception("Could not attach to thread"); |
| 20 | |
| 21 | jclass native_activity_clazz = java_env->GetObjectClass(g_App->activity->clazz); |
| 22 | if (native_activity_clazz == NULL) |
| 23 | throw satdump_exception("Could not get MainActivity class"); |
| 24 | |
| 25 | jmethodID method_id = java_env->GetMethodID(native_activity_clazz, "get_dpi", "()F"); |
| 26 | if (method_id == NULL) |
| 27 | throw satdump_exception("Could not get methode ID"); |
| 28 | |
| 29 | jfloat jflt = java_env->CallFloatMethod(g_App->activity->clazz, method_id); |
| 30 | |
| 31 | jni_return = java_vm->DetachCurrentThread(); |
| 32 | if (jni_return != JNI_OK) |
| 33 | throw satdump_exception("Could not detach from thread"); |
| 34 | |
| 35 | return jflt; |
| 36 | } |
| 37 | |
| 38 | void funcRebuildFonts() |
| 39 | { |
no outgoing calls
no test coverage detected