mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
[FriendsImpl] update java wrapper to add function getVcardToString from friend
This commit is contained in:
parent
e25d0c3efa
commit
0399162c4c
4 changed files with 23 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue