Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
liblinphone
Compare revisions
90738e58f63883acfe47ff7451a142bb88c7332d...cbe56f16db19a096de9edc1c9f4835c32322bf13
Source
BC/public/liblinphone
Select target project
cbe56f16db19a096de9edc1c9f4835c32322bf13
Select Git revision
..
..
...
Target
BC/public/liblinphone
Select target project
BC/public/liblinphone
90738e58f63883acfe47ff7451a142bb88c7332d
Select Git revision
Compare
Swap revisions
Commits (2)
Fixed issue with log collection callback not nil message
· dc249dc9
Sylvain Berfini
authored
3 years ago
dc249dc9
Removed jni_handle_exception from Java wrapper, causing app issues in listener to be hidden
· cbe56f16
Sylvain Berfini
authored
3 years ago
cbe56f16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+5
-0
CHANGELOG.md
coreapi/linphonecore.c
+3
-1
coreapi/linphonecore.c
wrappers/java/jni.mustache
+19
-6
wrappers/java/jni.mustache
with
27 additions
and
7 deletions
CHANGELOG.md
View file @
cbe56f16
...
...
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This changelog file was started on October 2019. Previous changes were more or less tracked in the
*NEWS*
file.
## [5.1.0] Unreleased
### Changed
-
Java wrapper no longer catches app exceptions that happens in listener
## [5.0.0] 2021-07-08
### Added
...
...
This diff is collapsed.
Click to expand it.
coreapi/linphonecore.c
View file @
cbe56f16
...
...
@@ -975,7 +975,7 @@ static void process_response_from_post_file_log_collection(void *data, const bel
char
*
first_part_header
;
belle_sip_user_body_handler_t
*
first_part_bh
;
linphone_core_notify_log_collection_upload_state_changed
(
core
,
LinphoneCoreLogCollectionUploadStateInProgress
,
NULL
);
linphone_core_notify_log_collection_upload_state_changed
(
core
,
LinphoneCoreLogCollectionUploadStateInProgress
,
"In progress"
);
/* Temporary storage for the Content-disposition header value */
first_part_header
=
belle_sip_strdup_printf
(
"form-data; name=
\"
File
\"
; filename=
\"
%s
\"
"
,
linphone_content_get_name
(
core
->
log_collection_upload_information
));
...
...
@@ -1163,6 +1163,8 @@ void linphone_core_upload_log_collection(LinphoneCore *core) {
msg
=
"Log collection upload server not set"
;
}
else
if
(
liblinphone_log_collection_state
==
LinphoneLogCollectionDisabled
)
{
msg
=
"Log collection is disabled"
;
}
else
{
msg
=
"Unknown error"
;
}
linphone_core_notify_log_collection_upload_state_changed
(
core
,
LinphoneCoreLogCollectionUploadStateNotDelivered
,
msg
);
}
...
...
This diff is collapsed.
Click to expand it.
wrappers/java/jni.mustache
View file @
cbe56f16
...
...
@@ -244,6 +244,9 @@ public:
ms_factory_class = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/mediastream/Factory"));
ms_factory_class_constructor = env->GetMethodID(ms_factory_class, "
<init>
", "(J)V");
throwable_class = (jclass)env->NewGlobalRef(env->FindClass("java/lang/Throwable"));
throwable_to_string = env->GetMethodID(throwable_class, "toString", "()Ljava/lang/String;");
{{#
objects
}}
{{
cPrefix
}}
_class = (jclass)env->NewGlobalRef(env->FindClass("
{{
jniPath
}}{{
classImplName
}}
"));
{{
cPrefix
}}
_class_constructor = env->GetMethodID(
{{
cPrefix
}}
_class, "
<init>
", "(JZ)V");
...
...
@@ -257,11 +260,12 @@ public:
~LinphoneJavaBindings() {
JNIEnv *env = ms_get_jni_env();
if (!env) {
bctbx_error("cannot attach VM");
}
if (!env) {
bctbx_error("cannot attach VM");
}
env->DeleteGlobalRef(ms_factory_class);
env->DeleteGlobalRef(throwable_class);
{{#
objects
}}
env->DeleteGlobalRef(
{{
cPrefix
}}
_class);
...
...
@@ -275,6 +279,9 @@ public:
jclass ms_factory_class;
jmethodID ms_factory_class_constructor;
jclass throwable_class;
jmethodID throwable_to_string;
{{#
objects
}}
jclass
{{
cPrefix
}}
_class;
jmethodID
{{
cPrefix
}}
_class_constructor;
...
...
@@ -356,12 +363,18 @@ JNIEXPORT jboolean JNICALL Java_{{jniPrefix}}{{classImplName}}_unref(JNIEnv* env
{{/
objects
}}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static inline void handle_possible_java_exception(JNIEnv *env, jobject listener)
static inline void handle_possible_java_exception(JNIEnv *env, jobject listener
, const char *listener_name
)
{
if (env->ExceptionCheck()) {
env->ExceptionDescribe();
jthrowable exception = env->ExceptionOccurred();
env->ExceptionClear();
bctbx_error("Listener %p raised an exception", listener);
LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_factory_get_user_data(linphone_factory_get());
jstring toString = (jstring) env->CallObjectMethod(exception, ljb->throwable_to_string);
const char * toStringChar = GetStringUTFChars(env, toString);
bctbx_error("Listener %s [%p] raised an exception: %s", listener_name, listener, toStringChar);
ReleaseStringUTFChars(env, toString, toStringChar);
}
}
...
...
@@ -458,7 +471,7 @@ static {{return}} {{callbackName}}({{params}}) {
}
{{/
jstrings
}}
handle_possible_java_exception(env, jlistener);
//
handle_possible_java_exception(env, jlistener
, "
{{
callbackName
}}
"
);
{{#
hasReturn
}}
return c_upcall_result;
{{/
hasReturn
}}
...
...
This diff is collapsed.
Click to expand it.
Menu
Explore
Projects
Groups
Topics
Snippets