Commit 5c63230d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Updated linphone to fix android tester random crash

parent 241bbf9e
Pipeline #2783 passed with stages
in 89 minutes and 37 seconds
Subproject commit c1d4e3870dce2de8e9c64fdd0bb5f9d26efb145a
Subproject commit b1e218bad5a2b701cb62e864d22d1794fafd7e67
......@@ -5,6 +5,19 @@ excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/LICENSE.txt')
static def isLocalAarAvailable() {
File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar')
File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar')
return debugAar.exists() || releaseAar.exists()
}
repositories {
maven {
// Switch to release for releases !
url "https://gitlab.linphone.org/BC/public/maven_repository/raw/master"
}
}
android {
compileSdkVersion 28
defaultConfig {
......@@ -45,7 +58,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation project(":linphone-sdk-android")
if (isLocalAarAvailable()) {
implementation project(":linphone-sdk-android")
} else {
implementation "org.linphone:linphone-sdk-android:4.1+"
}
// Required for instrumented tests
implementation 'androidx.test:runner:1.1.0'
......
......@@ -20,7 +20,6 @@ package org.linphone.tester;
*/
import android.content.Context;
import androidx.test.InstrumentationRegistry;
import org.junit.After;
import org.junit.Before;
......@@ -31,6 +30,8 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import androidx.test.platform.app.InstrumentationRegistry;
public class Tester {
public native void setApplicationContext(Context ct);
public native void removeApplicationContext();
......@@ -110,11 +111,11 @@ public class Tester {
System.loadLibrary("bctoolbox-tester");
System.loadLibrary("linphonetester");
keepAccounts(false);
//keepAccounts(true);
//keepAccounts(false);
keepAccounts(true);
if (mContext == null) {
mContext = InstrumentationRegistry.getTargetContext();
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
}
setApplicationContext(mContext);
......@@ -124,14 +125,14 @@ public class Tester {
@Before
public void initTest() {
if (mContext == null) {
mContext = InstrumentationRegistry.getTargetContext();
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
}
setApplicationContext(mContext);
}
@After
public void tearDown() {
//clearAccounts();
clearAccounts();
removeApplicationContext();
}
......
......@@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
......
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