Commit 0399162c authored by Brieuc Viel's avatar Brieuc Viel
Browse files

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