From f001aaae9798bf2250e4a8aa5edf4102261d03c3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 19 Jan 2016 14:07:41 +0100 Subject: [PATCH] This should fix broken JNI compilation --- coreapi/linphonecore_jni.cc | 12 ++++++++++-- java/common/org/linphone/core/LinphoneCore.java | 9 +++++++-- java/impl/org/linphone/core/LinphoneCoreImpl.java | 11 ++++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 93250f60d..c99033029 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1958,12 +1958,20 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_exportFriendsToVCardFile env->ReleaseStringUTFChars(jpath, path); } -extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFriendList(JNIEnv* env +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addFriendList(JNIEnv* env ,jobject thiz ,jlong lc ,jlong friendList ) { - linphone_core_set_friend_list((LinphoneCore*)lc,(LinphoneFriendList*)friendList); + linphone_core_add_friend_list((LinphoneCore*)lc,(LinphoneFriendList*)friendList); +} + +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFriendList(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jlong friendList + ) { + linphone_core_remove_friend_list((LinphoneCore*)lc,(LinphoneFriendList*)friendList); } extern "C" jobjectArray Java_org_linphone_core_LinphoneCoreImpl_getFriendList(JNIEnv* env diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 85c97f6eb..2e92cbec6 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1000,9 +1000,14 @@ public interface LinphoneCore { void addFriend(LinphoneFriend lf) throws LinphoneCoreException; /** - * Sets the friend list for the linphone core. + * Adds the friend list to the linphone core. */ - void setFriendList(LinphoneFriendList friendList) throws LinphoneCoreException; + void addFriendList(LinphoneFriendList friendList) throws LinphoneCoreException; + + /** + * Removes the friend list from the linphone core. + */ + void removeFriendList(LinphoneFriendList friendList) throws LinphoneCoreException; /** * Creates a friend list. diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 221817bc3..014430adc 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -96,7 +96,8 @@ class LinphoneCoreImpl implements LinphoneCore { private native void setPreviewWindowId(long nativePtr, Object wid); private native void setDeviceRotation(long nativePtr, int rotation); private native void addFriend(long nativePtr,long friend); - private native void setFriendList(long nativePtr,long friendList); + private native void addFriendList(long nativePtr,long friendList); + private native void removeFriendList(long nativePtr,long friendList); private native LinphoneFriend[] getFriendList(long nativePtr); private native void setPresenceInfo(long nativePtr, int minutes_away, String alternative_contact, int status); private native int getPresenceInfo(long nativePtr); @@ -458,8 +459,12 @@ class LinphoneCoreImpl implements LinphoneCore { return new LinphoneFriendListImpl(this); } - public synchronized void setFriendList(LinphoneFriendList friendList) throws LinphoneCoreException { - setFriendList(nativePtr,((LinphoneFriendListImpl)friendList).nativePtr); + public synchronized void addFriendList(LinphoneFriendList friendList) throws LinphoneCoreException { + addFriendList(nativePtr,((LinphoneFriendListImpl)friendList).nativePtr); + } + + public synchronized void removeFriendList(LinphoneFriendList friendList) throws LinphoneCoreException { + removeFriendList(nativePtr,((LinphoneFriendListImpl)friendList).nativePtr); } public synchronized LinphoneFriend[] getFriendList() {