Commit 64fc5a95 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added JNI wrapper for linphone_friend_list_set_uri and...

Added JNI wrapper for linphone_friend_list_set_uri and linphone_friend_list_synchronize_friends_from_server
parent 6a2a6200
...@@ -3188,6 +3188,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneFriendListImpl_newLinphoneFriend ...@@ -3188,6 +3188,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneFriendListImpl_newLinphoneFriend
return (jlong)fl; return (jlong)fl;
} }
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_setUri(JNIEnv* env, jobject thiz, jlong list, jstring juri) {
const char* uri = env->GetStringUTFChars(juri, NULL);
linphone_friend_list_set_uri((LinphoneFriendList*)list, uri);
env->ReleaseStringUTFChars(juri, uri);
}
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_synchronizeFriendsFromServer(JNIEnv* env, jobject thiz, jlong list) {
linphone_friend_list_synchronize_friends_from_server((LinphoneFriendList*)list);
}
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setAddress(JNIEnv* env extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setAddress(JNIEnv* env
,jobject thiz ,jobject thiz
,jlong ptr ,jlong ptr
......
...@@ -24,5 +24,7 @@ public interface LinphoneFriendList { ...@@ -24,5 +24,7 @@ public interface LinphoneFriendList {
public void addFriend(LinphoneFriend friend); public void addFriend(LinphoneFriend friend);
public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered); public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered);
public LinphoneFriend findFriendByUri(String uri); public LinphoneFriend findFriendByUri(String uri);
public void setUri(String uri);
public void synchronizeFriendsFromServer();
long getNativePtr(); long getNativePtr();
} }
...@@ -66,6 +66,22 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable { ...@@ -66,6 +66,22 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
} }
} }
private native void setUri(long nativePtr, String uri);
@Override
public void setUri(String uri) {
synchronized(getSyncObject()) {
return setUri(nativePtr, uri);
}
}
private native void synchronizeFriendsFromServer(long nativePtr);
@Override
public void synchronizeFriendsFromServer() {
synchronized(getSyncObject()) {
synchronizeFriendsFromServer(nativePtr);
}
}
/*reserved for JNI */ /*reserved for JNI */
protected LinphoneFriendListImpl(long aNativePtr) { protected LinphoneFriendListImpl(long aNativePtr) {
......
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