Commit 298e62c6 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Use do later to fix android tester

parent 49187f96
......@@ -428,14 +428,22 @@ extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHe
extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHelper_setNetworkReachable(JNIEnv* env, jobject thiz, jlong ptr, jboolean reachable) {
AndroidPlatformHelpers *androidPlatformHelper = static_cast<AndroidPlatformHelpers *>((void *)ptr);
androidPlatformHelper->setNetworkReachable(reachable);
belle_sip_main_loop_t *loop = belle_sip_stack_get_main_loop(static_cast<belle_sip_stack_t*>(androidPlatformHelper->getCore()->sal->getStackImpl()));
std::function<void(void)> fun = [androidPlatformHelper, reachable]() {
androidPlatformHelper->setNetworkReachable(reachable);
};
belle_sip_main_loop_cpp_do_later(loop, fun);
}
extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHelper_setHttpProxy(JNIEnv* env, jobject thiz, jlong ptr, jstring host, jint port) {
AndroidPlatformHelpers *androidPlatformHelper = static_cast<AndroidPlatformHelpers *>((void *)ptr);
const char *hostC = GetStringUTFChars(env, host);
androidPlatformHelper->setHttpProxy(hostC, port);
ReleaseStringUTFChars(env, host, hostC);
belle_sip_main_loop_t *loop = belle_sip_stack_get_main_loop(static_cast<belle_sip_stack_t*>(androidPlatformHelper->getCore()->sal->getStackImpl()));
std::function<void(void)> fun = [androidPlatformHelper, env, host, port]() {
const char *hostC = GetStringUTFChars(env, host);
androidPlatformHelper->setHttpProxy(hostC, port);
ReleaseStringUTFChars(env, host, hostC);
};
belle_sip_main_loop_cpp_do_later(loop, fun);
}
LINPHONE_END_NAMESPACE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment