Commit c20dea4b authored by Brieuc Viel's avatar Brieuc Viel
Browse files

Fix JNI crash about LinphoneCall.getCoference()

parent c253cb7b
......@@ -4316,8 +4316,8 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv
}
extern "C" jobject Jave_org_linphone_core_LinphoneCoreImpl_getConference(JNIEnv *env, jobject thiz, jlong pCore) {
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConference");
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)");
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl");
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)V");
LinphoneConference *conf = linphone_core_get_conference((LinphoneCore *)pCore);
if(conf) return env->NewObject(conference_class, conference_constructor, conf);
else return NULL;
......@@ -4457,9 +4457,9 @@ extern "C" void Java_org_linphone_core_LinphoneCallImpl_setAuthenticationTokenVe
linphone_call_set_authentication_token_verified(call, verified);
}
extern "C" jobject Java_org_linphnoe_core_LinphoneCallImpl_getConference(JNIEnv *env, jobject thiz, jlong ptr) {
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConference");
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)");
extern "C" jobject Java_org_linphone_core_LinphoneCallImpl_getConference(JNIEnv *env, jobject thiz, jlong ptr) {
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl");
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)V");
LinphoneConference *conf = linphone_call_get_conference((LinphoneCall *)ptr);
if(conf) return env->NewObject(conference_class, conference_constructor, conf);
return NULL;
......
......@@ -280,10 +280,11 @@ public interface LinphoneCall {
*/
boolean isInConference();
/**
* Get the pointer on the C conference instance associated to that call.
* @return A positive value if the call is part of a conference, 0 if not.
* Get the conference instance which the call is part of.
* @return An instance of #LinphoneConference if the call is part
* of a conference. null instead.
*/
long getConference();
LinphoneConference getConference();
/**
* Indicates whether an operation is in progress at the media side.
......
......@@ -165,10 +165,10 @@ class LinphoneCallImpl implements LinphoneCall {
}
public boolean isInConference() {
return getConference() != 0;
return getConference() != null;
}
private native long getConference(long nativePtr);
public long getConference() {
public native LinphoneConference getConference(long nativePtr);
public LinphoneConference getConference() {
return getConference(nativePtr);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment