Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
eeb4b52d
Commit
eeb4b52d
authored
Nov 16, 2012
by
Sylvain Berfini
🎩
Browse files
JNI glue for linphone_core_set_primary_contact
parent
6b32d7d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+16
-0
java/common/org/linphone/core/LinphoneCore.java
java/common/org/linphone/core/LinphoneCore.java
+5
-0
java/impl/org/linphone/core/LinphoneCoreImpl.java
java/impl/org/linphone/core/LinphoneCoreImpl.java
+5
-0
No files found.
coreapi/linphonecore_jni.cc
View file @
eeb4b52d
...
...
@@ -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
);
}
...
...
java/common/org/linphone/core/LinphoneCore.java
View file @
eeb4b52d
...
...
@@ -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
);
}
java/impl/org/linphone/core/LinphoneCoreImpl.java
View file @
eeb4b52d
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment