forked from mirrors/linphone-iphone
Merge remote-tracking branch 'remotes/origin/dev_presence_list'
- Fix memory leak in jni wrapper - Implemented findFriendByUri (LinphoneFriendList)
This commit is contained in:
commit
12e71eccbe
4 changed files with 25 additions and 0 deletions
|
|
@ -3084,6 +3084,18 @@ extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_setRLSUri(JNIEnv*
|
|||
,jstring jrlsUri) {
|
||||
const char* uri = env->GetStringUTFChars(jrlsUri, NULL);
|
||||
linphone_friend_list_set_rls_uri((LinphoneFriendList*)ptr,uri);
|
||||
env->ReleaseStringUTFChars(jrlsUri, uri);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneFriendListImpl_findFriendByUri(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong friendListptr
|
||||
,jstring juri) {
|
||||
const char* uri = env->GetStringUTFChars(juri, NULL);
|
||||
LinphoneFriend* lResult;
|
||||
lResult = linphone_friend_list_find_friend_by_uri((LinphoneFriendList*)friendListptr,uri);
|
||||
env->ReleaseStringUTFChars(juri, uri);
|
||||
return (jlong)lResult;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_addFriend(JNIEnv* env
|
||||
|
|
|
|||
|
|
@ -23,5 +23,6 @@ public interface LinphoneFriendList {
|
|||
public void setRLSUri(String uri);
|
||||
public void addFriend(LinphoneFriend friend);
|
||||
public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered);
|
||||
public LinphoneFriend findFriendByUri(String uri);
|
||||
long getNativePtr();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import java.io.IOException;
|
|||
|
||||
import org.linphone.core.LinphoneCall.State;
|
||||
import org.linphone.core.LinphoneCoreListener;
|
||||
import org.linphone.core.LinphoneProxyConfigImpl;
|
||||
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.Version;
|
||||
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
|
|||
private native void addFriend(long nativePtr,long friendPtr);
|
||||
private native void updateSubscriptions(long nativePtr,long proxyConfigPtr,boolean onlyWhenRegistered);
|
||||
private native Object getCore(long ptr);
|
||||
private native LinphoneFriend findFriendByUri(long nativePtr,String uri);
|
||||
|
||||
|
||||
|
||||
protected LinphoneFriendListImpl(LinphoneCoreImpl core) {
|
||||
|
|
@ -56,6 +58,14 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
|
|||
updateSubscriptions(nativePtr, ((LinphoneProxyConfigImpl)proxyConfig).nativePtr,onlyWhenRegistered);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneFriend findFriendByUri(String uri) {
|
||||
synchronized(getSyncObject()){
|
||||
return findFriendByUri(nativePtr,uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*reserved for JNI */
|
||||
protected LinphoneFriendListImpl(long aNativePtr) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue