mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 15:18:11 +00:00
Added JNI API to get default username and displayname
This commit is contained in:
parent
539ae4bb56
commit
fc61fbd1aa
3 changed files with 32 additions and 0 deletions
|
|
@ -769,6 +769,18 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv
|
|||
env->ReleaseStringUTFChars(jusername, username);
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getPrimaryContactUsername(JNIEnv* env, jobject thiz, jlong lc) {
|
||||
LinphoneAddress* identity = linphone_core_get_primary_contact_parsed((LinphoneCore*)lc);
|
||||
const char * username = linphone_address_get_username(identity);
|
||||
return username ? env->NewStringUTF(username) : NULL;
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getPrimaryContactDisplayName(JNIEnv* env, jobject thiz, jlong lc) {
|
||||
LinphoneAddress* identity = linphone_core_get_primary_contact_parsed((LinphoneCore*)lc);
|
||||
const char * displayname = linphone_address_get_display_name(identity);
|
||||
return displayname ? env->NewStringUTF(displayname) : NULL;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearProxyConfigs(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
linphone_core_clear_proxy_config((LinphoneCore*)lc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1280,6 +1280,16 @@ public interface LinphoneCore {
|
|||
*/
|
||||
void setPrimaryContact(String displayName, String username);
|
||||
|
||||
/**
|
||||
* Returns the username used if no LinphoneProxyConfig configured
|
||||
*/
|
||||
String getPrimaryContactUsername();
|
||||
|
||||
/**
|
||||
* Returns the display name used if no LinphoneProxyConfig configured
|
||||
*/
|
||||
String getPrimaryContactDisplayName();
|
||||
|
||||
/**
|
||||
* Enable/Disable the use of SIP INFO for DTMFs
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native void setIncomingTimeout(long nativePtr, int timeout);
|
||||
private native void setInCallTimeout(long nativePtr, int timeout);
|
||||
private native void setPrimaryContact(long nativePtr, String displayName, String username);
|
||||
private native String getPrimaryContactUsername(long nativePtr);
|
||||
private native String getPrimaryContactDisplayName(long nativePtr);
|
||||
private native void setChatDatabasePath(long nativePtr, String path);
|
||||
private native long[] getChatRooms(long nativePtr);
|
||||
|
||||
|
|
@ -894,6 +896,14 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
setPrimaryContact(nativePtr, displayName, username);
|
||||
}
|
||||
|
||||
public synchronized String getPrimaryContactUsername() {
|
||||
return getPrimaryContactUsername(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized String getPrimaryContactDisplayName() {
|
||||
return getPrimaryContactDisplayName(nativePtr);
|
||||
}
|
||||
|
||||
private native void setUseSipInfoForDtmfs(long ptr, boolean use);
|
||||
public synchronized void setUseSipInfoForDtmfs(boolean use) {
|
||||
setUseSipInfoForDtmfs(nativePtr, use);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue