find friend by URI added to JNI

This commit is contained in:
Christophe Deschamps 2015-12-24 00:33:36 +01:00
parent 820d26bacf
commit a142ea2981
4 changed files with 20 additions and 2 deletions

View file

@ -3007,8 +3007,13 @@ extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_updateSubscription
linphone_friend_list_update_subscriptions((LinphoneFriendList*)friendListptr,(LinphoneProxyConfig*)proxyConfigPtr,jonlyWhenRegistered);
}
extern "C" jlong Java_org_linphone_core_LinphoneFriendListImpl_findFriendByUri(JNIEnv* env
,jobject thiz
,jlong friendListptr
,jstring juri) {
const char* uri = env->GetStringUTFChars(juri, NULL);
return (jlong)linphone_friend_list_find_friend_by_uri((LinphoneFriendList*)friendListptr,uri);
}
extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_getAddress(JNIEnv* env
,jobject thiz

View file

@ -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();
}

View file

@ -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;

View file

@ -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) {