Added JNI method enableSubscriptions for LinphoneFriendList

This commit is contained in:
Sylvain Berfini 2016-04-27 14:29:30 +02:00
parent db56234ba1
commit ad382a060c
3 changed files with 13 additions and 0 deletions

View file

@ -2061,6 +2061,10 @@ extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_exportFriendsToVCa
env->ReleaseStringUTFChars(jpath, path);
}
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_enableSubscriptions(JNIEnv* env, jobject thiz, jlong list, jboolean enable) {
linphone_friend_list_enable_subscriptions((LinphoneFriendList*)list, enable);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addFriendList(JNIEnv* env
,jobject thiz
,jlong lc

View file

@ -29,6 +29,7 @@ public interface LinphoneFriendList {
public LinphoneFriend[] getFriendList();
public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered);
public void closeSubscriptions();
public void enableSubscriptions(boolean enable);
public LinphoneFriend findFriendByUri(String uri);
public void setUri(String uri);
public void synchronizeFriendsFromServer();

View file

@ -31,6 +31,7 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
private native LinphoneFriend[] getFriendList(long nativePtr);
private native void updateSubscriptions(long nativePtr, long proxyConfigPtr, boolean onlyWhenRegistered);
private native void closeSubscriptions(long nativePtr);
private native void enableSubscriptions(long nativePtr, boolean enable);
private native Object getCore(long ptr);
private native LinphoneFriend findFriendByUri(long nativePtr, String uri);
private native void setListener(long ptr, LinphoneFriendListListener listener);
@ -81,6 +82,13 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
}
}
@Override
public void enableSubscriptions(boolean enable) {
synchronized(getSyncObject()) {
enableSubscriptions(nativePtr, enable);
}
}
@Override
public LinphoneFriend findFriendByUri(String uri) {
synchronized(getSyncObject()){