Add jni interface for get_last_error_string
This commit is contained in:
parent
df6d045f45
commit
bd7ff9b10f
@ -86,6 +86,8 @@ public class LibFreeRDP {
|
||||
|
||||
private static native boolean freerdp_send_clipboard_data(long inst, String data);
|
||||
|
||||
private static native String freerdp_get_last_error_string(long inst);
|
||||
|
||||
public static void setEventListener(EventListener l) {
|
||||
listener = l;
|
||||
}
|
||||
|
@ -793,6 +793,17 @@ static void JNICALL jni_freerdp_free(JNIEnv* env, jclass cls, jlong instance)
|
||||
#endif
|
||||
}
|
||||
|
||||
static jstring JNICALL jni_freerdp_get_last_error_string(JNIEnv* env, jclass cls, jlong instance)
|
||||
{
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
|
||||
if (!inst || !inst->context)
|
||||
return (*env)->NewStringUTF(env, "");
|
||||
|
||||
return (*env)->NewStringUTF(env,
|
||||
freerdp_get_last_error_string(freerdp_get_last_error(inst->context)));
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_parse_arguments(
|
||||
JNIEnv* env, jclass cls, jlong instance, jobjectArray arguments)
|
||||
{
|
||||
@ -1101,6 +1112,11 @@ static JNINativeMethod methods[] =
|
||||
"()Ljava/lang/String;",
|
||||
&jni_freerdp_get_build_config
|
||||
},
|
||||
{
|
||||
"freerdp_get_last_error_string",
|
||||
"(J)Ljava/lang/String;",
|
||||
&jni_freerdp_get_last_error_string
|
||||
},
|
||||
{
|
||||
"freerdp_new",
|
||||
"(Landroid/content/Context;)J",
|
||||
|
Loading…
Reference in New Issue
Block a user