Commit 0399162c authored by Brieuc's avatar Brieuc

[FriendsImpl] update java wrapper to add function getVcardToString from friend

parent e25d0c3e
......@@ -4284,6 +4284,15 @@ extern "C" jobject Java_org_linphone_core_LinphoneFriendImpl_getCore(JNIEnv* en
return NULL;
}
extern "C" jstring Java_org_linphone_core_LinphoneFriendImpl_getVcardToString(JNIEnv* env
,jobject thiz
,jlong ptr) {
LinphoneFriend *lf = (LinphoneFriend*)ptr;
LinphoneVcard *lvc = linphone_friend_get_vcard(lf);
const char* vcard = linphone_vcard_as_vcard4_string(lvc);
return vcard ? env->NewStringUTF(vcard) : NULL;
}
extern "C" jobject Java_org_linphone_core_LinphoneFriendListImpl_getCore(JNIEnv* env
,jobject thiz
,jlong ptr) {
......
......@@ -165,6 +165,12 @@ public interface LinphoneFriend {
* @return The reference key of the friend.
**/
String getRefKey();
/**
* return a the string value of the vcard corresponding to the given friend
*/
String getVcardToString();
/**
* Set a name for this friend
* @param name
......
......@@ -195,7 +195,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native Object createFriend(long nativePtr);
private native Object createFriendWithAddress(long nativePtr, String address);
private native int getIncomingTimeout(long nativePtr);
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException {
mListener = listener;
String user = userConfig == null ? null : userConfig.getCanonicalPath();
......
......@@ -40,6 +40,7 @@ public class LinphoneFriendImpl implements LinphoneFriend, Serializable {
private native Object getCore(long ptr);
private native void setRefKey(long nativePtr, String key);
private native String getRefKey(long nativePtr);
private native String getVcardToString(long nativePtr);
private Object userdData;
public Object getUserData() {
......@@ -141,6 +142,12 @@ public class LinphoneFriendImpl implements LinphoneFriend, Serializable {
public String getRefKey(){
return getRefKey(nativePtr);
}
public synchronized String getVcardToString() {
return getVcardToString(nativePtr);
}
private native void setName(long nativePtr, String name);
@Override
......
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