mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
JNI glue for linphone_core_set_primary_contact
This commit is contained in:
parent
6b32d7d6c6
commit
eeb4b52d1e
3 changed files with 26 additions and 0 deletions
|
|
@ -542,6 +542,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env
|
|||
delete lcData;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv* env, jobject thiz, jlong lc, jstring jdisplayname, jstring jusername) {
|
||||
const char* displayname = env->GetStringUTFChars(jdisplayname, NULL);
|
||||
const char* username = env->GetStringUTFChars(jusername, NULL);
|
||||
|
||||
LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed((LinphoneCore*)lc);
|
||||
if (parsed != NULL) {
|
||||
linphone_address_set_display_name(parsed, displayname);
|
||||
linphone_address_set_username(parsed, username);
|
||||
char *contact = linphone_address_as_string(parsed);
|
||||
linphone_core_set_primary_contact((LinphoneCore*)lc, contact);
|
||||
}
|
||||
|
||||
env->ReleaseStringUTFChars(jdisplayname, displayname);
|
||||
env->ReleaseStringUTFChars(jusername, username);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearProxyConfigs(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
linphone_core_clear_proxy_config((LinphoneCore*)lc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -851,4 +851,9 @@ public interface LinphoneCore {
|
|||
void setInCallTimeout(int timeout);
|
||||
|
||||
void setMicrophoneGain(float gain);
|
||||
|
||||
/**
|
||||
* Set username and display name to use if no LinphoneProxyConfig configured
|
||||
*/
|
||||
void setPrimaryContact(String displayName, String username);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native void setVideoPortRange(long nativePtr, int minPort, int maxPort);
|
||||
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);
|
||||
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||
mListener=listener;
|
||||
|
|
@ -793,4 +794,8 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public void setMicrophoneGain(float gain) {
|
||||
setMicrophoneGain(nativePtr, gain);
|
||||
}
|
||||
|
||||
public void setPrimaryContact(String displayName, String username) {
|
||||
setPrimaryContact(nativePtr, displayName, username);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue