Commit 24aa60fe authored by Nicolas Michon's avatar Nicolas Michon

Fixed rebase mistake

parent 4a7d2211
......@@ -72,29 +72,29 @@ private:
static jmethodID getMethodId (JNIEnv *env, jclass klass, const char *method, const char *signature);
string getNativeLibraryDir();
jobject mJavaHelper;
jmethodID mWifiLockAcquireId;
jmethodID mWifiLockReleaseId;
jmethodID mMcastLockAcquireId;
jmethodID mMcastLockReleaseId;
jmethodID mCpuLockAcquireId;
jmethodID mCpuLockReleaseId;
jmethodID mGetDnsServersId;
jmethodID mGetPowerManagerId;
jmethodID mGetDataPathId;
jmethodID mGetConfigPathId;
jmethodID mGetDownloadPathId;
jmethodID mGetNativeLibraryDirId;
jmethodID mSetNativeVideoWindowId;
jmethodID mSetNativePreviewVideoWindowId;
jmethodID mUpdateNetworkReachabilityId;
jmethodID mOnLinphoneCoreStartId;
jmethodID mOnLinphoneCoreStopId;
jmethodID mOnWifiOnlyEnabledId;
jobject mPreviewVideoWindow;
jobject mVideoWindow;
bool mNetworkReachable;
jobject mJavaHelper = nullptr;
jmethodID mWifiLockAcquireId = nullptr;
jmethodID mWifiLockReleaseId = nullptr;
jmethodID mMcastLockAcquireId = nullptr;
jmethodID mMcastLockReleaseId = nullptr;
jmethodID mCpuLockAcquireId = nullptr;
jmethodID mCpuLockReleaseId = nullptr;
jmethodID mGetDnsServersId = nullptr;
jmethodID mGetPowerManagerId = nullptr;
jmethodID mGetDataPathId = nullptr;
jmethodID mGetConfigPathId = nullptr;
jmethodID mGetDownloadPathId = nullptr;
jmethodID mGetNativeLibraryDirId = nullptr;
jmethodID mSetNativeVideoWindowId = nullptr;
jmethodID mSetNativePreviewVideoWindowId = nullptr;
jmethodID mUpdateNetworkReachabilityId = nullptr;
jmethodID mOnLinphoneCoreStartId = nullptr;
jmethodID mOnLinphoneCoreStopId = nullptr;
jmethodID mOnWifiOnlyEnabledId = nullptr;
jobject mPreviewVideoWindow = nullptr;
jobject mVideoWindow = nullptr;
bool mNetworkReachable = false;
};
static const char *GetStringUTFChars (JNIEnv *env, jstring string) {
......@@ -212,7 +212,7 @@ string AndroidPlatformHelpers::getDownloadPath () {
string downloadPath = download_path;
ReleaseStringUTFChars(env, jdownload_path, download_path);
return downloadPath + "/";
}
}
string AndroidPlatformHelpers::getDataPath () const {
JNIEnv *env = ms_get_jni_env();
......@@ -296,13 +296,13 @@ void AndroidPlatformHelpers::setHttpProxy(const string &host, int port) {
}
void AndroidPlatformHelpers::setDnsServers () {
if (!mJavaHelper || linphone_core_get_dns_set_by_app(mCore)) {
if (!mJavaHelper) {
lError() << "AndroidPlatformHelpers' mJavaHelper is null.";
return;
}
if (linphone_core_get_dns_set_by_app(getCore()->getCCore())) return;
JNIEnv *env = ms_get_jni_env();
if (env && mJavaHelper) {
if (env) {
jobjectArray jservers = (jobjectArray)env->CallObjectMethod(mJavaHelper, mGetDnsServersId);
bctbx_list_t *l = nullptr;
if (env->ExceptionCheck()) {
......@@ -315,15 +315,16 @@ void AndroidPlatformHelpers::setDnsServers () {
for (int i = 0; i < count; i++) {
jstring jserver = (jstring)env->GetObjectArrayElement(jservers, i);
const char *str = env->GetStringUTFChars(jserver, nullptr);
const char *str = GetStringUTFChars(env, jserver);
if (str) {
lInfo() << "AndroidPlatformHelpers found DNS server " << str;
l = bctbx_list_append(l, ms_strdup(str));
env->ReleaseStringUTFChars(jserver, str);
ReleaseStringUTFChars(env, jserver, str);
}
}
} else {
lError() << "AndroidPlatformHelpers::setDnsServers() failed to get DNS servers list";
return;
}
linphone_core_set_dns_servers(getCore()->getCCore(), l);
bctbx_list_free_with_data(l, ms_free);
......@@ -415,12 +416,12 @@ PlatformHelpers *createAndroidPlatformHelpers (std::shared_ptr<LinphonePrivate::
}
extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHelper_setNativePreviewWindowId(JNIEnv *env, jobject thiz, jlong ptr, jobject id) {
AndroidPlatformHelpers *androidPlatformHelper = (AndroidPlatformHelpers *)ptr;
AndroidPlatformHelpers *androidPlatformHelper = static_cast<AndroidPlatformHelpers *>((void *)ptr);
androidPlatformHelper->_setPreviewVideoWindow(id);
}
extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHelper_setNativeVideoWindowId(JNIEnv *env, jobject thiz, jlong ptr, jobject id) {
AndroidPlatformHelpers *androidPlatformHelper = (AndroidPlatformHelpers *)ptr;
AndroidPlatformHelpers *androidPlatformHelper = static_cast<AndroidPlatformHelpers *>((void *)ptr);
androidPlatformHelper->_setVideoWindow(id);
}
......@@ -430,10 +431,11 @@ extern "C" JNIEXPORT void JNICALL Java_org_linphone_core_tools_AndroidPlatformHe
androidPlatformHelper->setNetworkReachable(reachable);
};
androidPlatformHelper->getCore()->doLater(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 = (AndroidPlatformHelpers *)ptr;
AndroidPlatformHelpers *androidPlatformHelper = static_cast<AndroidPlatformHelpers *>((void *)ptr);
const char *hostC = GetStringUTFChars(env, host);
char * httpProxyHost = ms_strdup(hostC);
ReleaseStringUTFChars(env, host, hostC);
......
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