Commit 638c7730 authored by Simon Morlat's avatar Simon Morlat

fix build issues

parent 7ee83e56
......@@ -3752,9 +3752,16 @@ extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_setRLSUri(JNIEnv*
,jobject thiz
,jlong ptr
,jstring jrlsUri) {
const char* uri = GetStringUTFChars(env, jrlsUri);
const char* uri = jrlsUri ? GetStringUTFChars(env, jrlsUri) : NULL;
linphone_friend_list_set_rls_uri((LinphoneFriendList*)ptr, uri);
ReleaseStringUTFChars(env, jrlsUri, uri);
if (jrlsUri) ReleaseStringUTFChars(env, jrlsUri, uri);
}
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_setRLSAddress(JNIEnv* env
,jobject thiz
,jlong ptr
,jlong jrlsAddress) {
linphone_friend_list_set_rls_address((LinphoneFriendList*)ptr, (LinphoneAddress*)jrlsAddress);
}
extern "C" jobject Java_org_linphone_core_LinphoneFriendListImpl_findFriendByUri(JNIEnv* env
......@@ -3810,10 +3817,8 @@ extern "C" jobjectArray Java_org_linphone_core_LinphoneFriendListImpl_getFriendL
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_updateSubscriptions(JNIEnv* env
,jobject thiz
,jlong friendListptr
,jlong proxyConfigPtr
,jboolean jonlyWhenRegistered) {
linphone_friend_list_update_subscriptions((LinphoneFriendList*)friendListptr, (LinphoneProxyConfig*)proxyConfigPtr, jonlyWhenRegistered);
,jlong friendListptr) {
linphone_friend_list_update_subscriptions((LinphoneFriendList*)friendListptr);
}
extern "C" jlongArray Java_org_linphone_core_LinphoneFriendImpl_getAddresses(JNIEnv* env
......
......@@ -21,13 +21,15 @@ package org.linphone.core;
import java.util.Vector;
import org.linphone.core.LinphoneChatMessage.State;
import org.linphone.core.LinphoneAddress;
public interface LinphoneFriendList {
public void setRLSAddress(LinphoneAddress addr);
public void setRLSUri(String uri);
public void addFriend(LinphoneFriend friend);
public void addLocalFriend(LinphoneFriend friend);
public LinphoneFriend[] getFriendList();
public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered);
public void updateSubscriptions();
public void enableSubscriptions(boolean enable);
public LinphoneFriend findFriendByUri(String uri);
public void setUri(String uri);
......
......@@ -25,11 +25,12 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
protected final long nativePtr;
private native void finalize(long nativePtr);
private native long newLinphoneFriendList(long corePtr);
private native void setRLSAddress(long nativePtr, long addrPtr);
private native void setRLSUri(long nativePtr, String uri);
private native void addFriend(long nativePtr, long friendPtr);
private native void addLocalFriend(long nativePtr, long friendPtr);
private native LinphoneFriend[] getFriendList(long nativePtr);
private native void updateSubscriptions(long nativePtr, long proxyConfigPtr, boolean onlyWhenRegistered);
private native void updateSubscriptions(long nativePtr);
private native void enableSubscriptions(long nativePtr, boolean enable);
private native Object getCore(long ptr);
private native LinphoneFriend findFriendByUri(long nativePtr, String uri);
......@@ -39,6 +40,13 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
nativePtr = newLinphoneFriendList(core.nativePtr);
}
@Override
public void setRLSAddress(LinphoneAddress addr){
synchronized(getSyncObject()){
setRLSAddress(nativePtr, ((LinphoneAddressImpl)addr).nativePtr);
}
}
@Override
public void setRLSUri(String uri) {
synchronized(getSyncObject()){
......@@ -68,9 +76,9 @@ class LinphoneFriendListImpl implements LinphoneFriendList, Serializable {
}
@Override
public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered) {
public void updateSubscriptions() {
synchronized(getSyncObject()){
updateSubscriptions(nativePtr, ((LinphoneProxyConfigImpl)proxyConfig).nativePtr,onlyWhenRegistered);
updateSubscriptions(nativePtr);
}
}
......
......@@ -281,7 +281,7 @@ static void friends_sqlite_storage(void) {
bctbx_list_t *friends_lists_from_db = NULL;
char *friends_db = bc_tester_file("friends.db");
LinphoneFriendListStats *stats = (LinphoneFriendListStats *)ms_new0(LinphoneFriendListStats, 1);
LinphoneAddress *laddress = NULL, *laddress2 = NULL;
const LinphoneAddress *laddress = NULL, *laddress2 = NULL;
char *address = NULL, *address2 = NULL;
v_table->friend_list_created = friend_list_created_cb;
......@@ -340,8 +340,7 @@ static void friends_sqlite_storage(void) {
laddress2 = linphone_friend_get_address(lf2);
address2 = linphone_address_as_string(laddress2);
BC_ASSERT_STRING_EQUAL(address2, address);
linphone_address_unref(laddress);
linphone_address_unref(laddress2);
ms_free(address);
ms_free(address2);
......@@ -593,7 +592,7 @@ static void carddav_integration(void) {
LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)ms_new0(LinphoneCardDAVStats, 1);
const char *refkey = "toto";
char *address = NULL;
LinphoneAddress *addr;
const LinphoneAddress *addr;
linphone_friend_list_set_uri(lfl, CARDDAV_SERVER);
cbs = linphone_friend_list_get_callbacks(lfl);
......@@ -651,7 +650,7 @@ static void carddav_integration(void) {
address = linphone_address_as_string_uri_only(addr);
BC_ASSERT_STRING_EQUAL(address, "sip:sylvain@sip.linphone.org");
ms_free(address);
linphone_address_unref(addr);
linphone_friend_edit(lf);
linphone_friend_done(lf);
......
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