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
f151d70d
Commit
f151d70d
authored
Dec 14, 2015
by
Christophe Deschamps
Browse files
retired LinphoneContentPrivate in JNI & fixed Android compilation (friendlist)
parent
5269c01b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
138 deletions
+33
-138
build/android/Android.mk
build/android/Android.mk
+1
-0
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+32
-138
No files found.
build/android/Android.mk
View file @
f151d70d
...
...
@@ -53,6 +53,7 @@ LOCAL_SRC_FILES := \
enum.c
\
event.c
\
friend.c
\
friendlist.c
\
info.c
\
linphonecall.c
\
linphonecore.c
\
...
...
coreapi/linphonecore_jni.cc
View file @
f151d70d
...
...
@@ -3182,17 +3182,10 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_markAsRead(JNIEnv*
extern
"C"
jlong
Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferMessage
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
,
jstring
jname
,
jstring
jtype
,
jstring
jsubtype
,
jint
data_size
)
{
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneChatMessage
*
message
=
NULL
;
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
name
=
(
char
*
)
env
->
GetStringUTFChars
(
jname
,
NULL
);
content
.
size
=
data_size
;
message
=
linphone_chat_room_create_file_transfer_message
((
LinphoneChatRoom
*
)
ptr
,
LINPHONE_CONTENT
(
&
content
));
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
env
->
ReleaseStringUTFChars
(
jname
,
content
.
name
);
message
=
linphone_chat_room_create_file_transfer_message
((
LinphoneChatRoom
*
)
ptr
,
&
content
);
return
(
jlong
)
message
;
}
...
...
@@ -4576,24 +4569,14 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIE
jstring
jevname
,
jint
expires
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
){
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
coreptr
;
LinphoneAddress
*
addr
=
(
LinphoneAddress
*
)
addrptr
;
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneEvent
*
ev
;
jobject
jev
=
NULL
;
const
char
*
evname
=
env
->
GetStringUTFChars
(
jevname
,
NULL
);
ev
=
linphone_core_subscribe
(
lc
,
addr
,
evname
,
expires
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
if
(
jtype
){
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jencoding
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
ev
=
linphone_core_subscribe
(
lc
,
addr
,
evname
,
expires
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
if
(
jtype
){
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
linphone_content_get_user_data
(
&
content
),
JNI_ABORT
);
}
env
->
ReleaseStringUTFChars
(
jevname
,
evname
);
if
(
ev
){
...
...
@@ -4611,24 +4594,16 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_publish(JNIEnv
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
){
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
coreptr
;
LinphoneAddress
*
addr
=
(
LinphoneAddress
*
)
addrptr
;
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneEvent
*
ev
;
jobject
jev
=
NULL
;
const
char
*
evname
=
env
->
GetStringUTFChars
(
jevname
,
NULL
);
ev
=
linphone_core_subscribe
(
lc
,
addr
,
evname
,
expires
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
if
(
jtype
){
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jencoding
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
ev
=
linphone_core_publish
(
lc
,
addr
,
evname
,
expires
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
if
(
jtype
){
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
linphone_content_get_user_data
(
&
content
),
JNI_ABORT
);
}
env
->
ReleaseStringUTFChars
(
jevname
,
evname
);
if
(
ev
){
...
...
@@ -4771,33 +4746,24 @@ static jobject create_java_linphone_content(JNIEnv *env, const LinphoneContent *
jstring
jtype
,
jsubtype
,
jencoding
,
jname
;
jbyteArray
jdata
=
NULL
;
jint
jsize
=
0
;
const
LinphoneContentPrivate
*
content
=
LINPHONE_CONTENT_PRIVATE
(
icontent
);
contentClass
=
(
jclass
)
env
->
FindClass
(
"org/linphone/core/LinphoneContentImpl"
);
ctor
=
env
->
GetMethodID
(
contentClass
,
"<init>"
,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BLjava/lang/String;I)V"
);
jtype
=
env
->
NewStringUTF
(
content
->
type
);
jsubtype
=
env
->
NewStringUTF
(
content
->
subtype
);
jencoding
=
content
->
encoding
?
env
->
NewStringUTF
(
content
->
encoding
)
:
NULL
;
jname
=
content
->
name
?
env
->
NewStringUTF
(
content
->
name
)
:
NULL
;
jsize
=
(
jint
)
content
->
size
;
jtype
=
env
->
NewStringUTF
(
linphone_content_get_type
(
icontent
)
);
jsubtype
=
env
->
NewStringUTF
(
linphone_
content
_get_
subtype
(
icontent
)
);
jencoding
=
linphone_
content
_get_
encoding
(
icontent
)
?
env
->
NewStringUTF
(
linphone_
content
_get_
encoding
(
icontent
)
)
:
NULL
;
jname
=
linphone_content_get_name
(
icontent
)
?
env
->
NewStringUTF
(
linphone_content_get_name
(
icontent
)
)
:
NULL
;
jsize
=
(
jint
)
linphone_content_get_size
(
icontent
)
;
if
(
content
->
data
){
jdata
=
env
->
NewByteArray
(
content
->
size
);
env
->
SetByteArrayRegion
(
jdata
,
0
,
content
->
size
,
(
jbyte
*
)
content
->
data
);
if
(
linphone_content_get_user_data
(
icontent
)
){
jdata
=
env
->
NewByteArray
(
linphone_content_get_size
(
icontent
)
);
env
->
SetByteArrayRegion
(
jdata
,
0
,
linphone_content_get_size
(
icontent
),
(
jbyte
*
)
linphone_content_get_user_data
(
icontent
)
);
}
jobject
jobj
=
env
->
NewObject
(
contentClass
,
ctor
,
jname
,
jtype
,
jsubtype
,
jdata
,
jencoding
,
jsize
);
env
->
DeleteLocalRef
(
contentClass
);
env
->
DeleteLocalRef
(
jtype
);
env
->
DeleteLocalRef
(
jsubtype
);
if
(
jencoding
)
{
env
->
DeleteLocalRef
(
jencoding
);
}
if
(
jname
)
{
env
->
DeleteLocalRef
(
jname
);
}
return
jobj
;
}
...
...
@@ -4867,16 +4833,9 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_getCont
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneInfoMessageImpl_setContent
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
infoptr
,
jstring
jtype
,
jstring
jsubtype
,
jstring
jdata
){
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
data
=
(
void
*
)
env
->
GetStringUTFChars
(
jdata
,
NULL
);
content
.
size
=
strlen
((
char
*
)
content
.
data
);
linphone_info_message_set_content
((
LinphoneInfoMessage
*
)
infoptr
,
LINPHONE_CONTENT
(
&
content
));
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
env
->
ReleaseStringUTFChars
(
jdata
,(
char
*
)
content
.
data
);
linphone_info_message_set_content
((
LinphoneInfoMessage
*
)
infoptr
,
&
content
);
}
/*
...
...
@@ -4975,26 +4934,13 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_denySubscription
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
*/
JNIEXPORT
jint
JNICALL
Java_org_linphone_core_LinphoneEventImpl_notify
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
evptr
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
){
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneEvent
*
ev
=
(
LinphoneEvent
*
)
evptr
;
jint
err
;
if
(
jtype
){
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
err
=
linphone_event_notify
(
ev
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
err
=
linphone_event_notify
(
ev
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
if
(
jtype
){
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
}
return
err
;
}
...
...
@@ -5004,26 +4950,12 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
*/
JNIEXPORT
jint
JNICALL
Java_org_linphone_core_LinphoneEventImpl_updateSubscribe
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
evptr
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
){
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneEvent
*
ev
=
(
LinphoneEvent
*
)
evptr
;
jint
err
;
if
(
jtype
){
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
err
=
linphone_event_update_subscribe
(
ev
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
err
=
linphone_event_update_subscribe
(
ev
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
if
(
jtype
){
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
}
return
err
;
}
...
...
@@ -5033,26 +4965,12 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
*/
JNIEXPORT
jint
JNICALL
Java_org_linphone_core_LinphoneEventImpl_updatePublish
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
evptr
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
){
LinphoneContent
Private
content
=
{
0
};
LinphoneContent
content
=
{
0
};
LinphoneEvent
*
ev
=
(
LinphoneEvent
*
)
evptr
;
jint
err
;
if
(
jtype
){
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
err
=
linphone_event_update_publish
(
ev
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
err
=
linphone_event_update_publish
(
ev
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
if
(
jtype
){
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
}
return
err
;
}
...
...
@@ -5118,21 +5036,8 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_createSubscrib
}
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneEventImpl_sendSubscribe
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
jevent
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
)
{
LinphoneContentPrivate
content
=
{
0
};
if
(
jtype
)
{
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jencoding
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
linphone_event_send_subscribe
((
LinphoneEvent
*
)
jevent
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
if
(
jtype
)
{
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,
(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
}
LinphoneContent
content
=
{
0
};
linphone_event_send_subscribe
((
LinphoneEvent
*
)
jevent
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
}
JNIEXPORT
jobject
JNICALL
Java_org_linphone_core_LinphoneCoreImpl_createPublish
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
jcore
,
jlong
jaddr
,
jstring
jeventname
,
jint
expires
)
{
...
...
@@ -5151,21 +5056,10 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_createPublish(
}
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneEventImpl_sendPublish
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
jevent
,
jstring
jtype
,
jstring
jsubtype
,
jbyteArray
jdata
,
jstring
jencoding
)
{
LinphoneContentPrivate
content
=
{
0
};
if
(
jtype
)
{
content
.
type
=
(
char
*
)
env
->
GetStringUTFChars
(
jtype
,
NULL
);
content
.
subtype
=
(
char
*
)
env
->
GetStringUTFChars
(
jsubtype
,
NULL
);
content
.
encoding
=
jencoding
?
(
char
*
)
env
->
GetStringUTFChars
(
jencoding
,
NULL
)
:
NULL
;
content
.
data
=
(
void
*
)
env
->
GetByteArrayElements
(
jdata
,
NULL
);
content
.
size
=
env
->
GetArrayLength
(
jdata
);
}
linphone_event_send_publish
((
LinphoneEvent
*
)
jevent
,
content
.
type
?
LINPHONE_CONTENT
(
&
content
)
:
NULL
);
if
(
jtype
)
{
env
->
ReleaseStringUTFChars
(
jtype
,
content
.
type
);
env
->
ReleaseStringUTFChars
(
jsubtype
,
content
.
subtype
);
if
(
jencoding
)
env
->
ReleaseStringUTFChars
(
jencoding
,
content
.
encoding
);
env
->
ReleaseByteArrayElements
(
jdata
,
(
jbyte
*
)
content
.
data
,
JNI_ABORT
);
}
LinphoneContent
content
=
{
0
};
linphone_event_send_publish
((
LinphoneEvent
*
)
jevent
,
linphone_content_get_type
(
&
content
)
?
&
content
:
NULL
);
}
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneEventImpl_addCustomHeader
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
jevent
,
jstring
jname
,
jstring
jvalue
)
{
...
...
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