diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 5fe67bd64..856c26ba5 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2216,8 +2216,9 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig // We need the Sal on the Android platform helper init msplugins_dir = linphone_factory_get_msplugins_dir(lfactory); - image_resources_dir = linphone_factory_get_image_resources_dir(lfactory); - lc->sal=new Sal(NULL); + image_resources_dir = linphone_factory_get_image_resources_dir(lfactory); + lc->factory = ms_factory_new_with_voip_and_directories(msplugins_dir, image_resources_dir); + lc->sal=new Sal(lc->factory); lc->sal->set_http_proxy_host(linphone_core_get_http_proxy_host(lc)); lc->sal->set_http_proxy_port(linphone_core_get_http_proxy_port(lc)); diff --git a/src/core/platform-helpers/android-platform-helpers.cpp b/src/core/platform-helpers/android-platform-helpers.cpp index b63eea3d4..ca6fa3c89 100644 --- a/src/core/platform-helpers/android-platform-helpers.cpp +++ b/src/core/platform-helpers/android-platform-helpers.cpp @@ -104,7 +104,7 @@ AndroidPlatformHelpers::AndroidPlatformHelpers (LinphoneCore *lc, void *systemCo mGetConfigPathId = getMethodId(env, klass, "getConfigPath", "()Ljava/lang/String;"); jmethodID initCoreId = getMethodId(env, klass, "initCore", "(J)V"); - env->CallVoidMethod(mJavaHelper, initCoreId, (jlong)lc); + env->CallVoidMethod(mJavaHelper, initCoreId, lc); jobject pm = env->CallObjectMethod(mJavaHelper, mGetPowerManagerId); belle_sip_wake_lock_init(env, pm); diff --git a/wrappers/java/classes/tools/AndroidPlatformHelper.java b/wrappers/java/classes/tools/AndroidPlatformHelper.java index 0faec2d12..b90a3cea0 100644 --- a/wrappers/java/classes/tools/AndroidPlatformHelper.java +++ b/wrappers/java/classes/tools/AndroidPlatformHelper.java @@ -238,9 +238,9 @@ public class AndroidPlatformHelper { } } - public void copyFromPackage(int ressourceId, String target) throws IOException { - InputStream lInputStream = mResources.openRawResource(ressourceId); + public void copyFromPackage(int ressourceId, String target) throws IOException{ FileOutputStream lOutputStream = mContext.openFileOutput (target, 0); + InputStream lInputStream = mResources.openRawResource(ressourceId); int readByte; byte[] buff = new byte[8048]; while (( readByte = lInputStream.read(buff)) != -1) {