mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
Fix JNI crash about LinphoneCall.getCoference()
This commit is contained in:
parent
c253cb7b77
commit
c20dea4b94
3 changed files with 12 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue