Merge remote-tracking branch 'android-master/master' into 3.0.X

This commit is contained in:
Margaux Clerc 2015-10-15 10:54:02 +02:00
commit 13882d8338
11 changed files with 65 additions and 51 deletions

4
.gitignore vendored
View file

@ -38,3 +38,7 @@ tests/*$py.class
tests/build.xml
tests/project.properties
ant_password.properties
liblinphone_tester/liblinphonetester_*
liblinphone_tester/tests.output
tests/linphonetester_*
tests/tests.output

12
.gitmodules vendored
View file

@ -1,12 +1,12 @@
[submodule "linphone"]
path = submodules/linphone
url = git://git.linphone.org/linphone
url = git://git.linphone.org/linphone.git
[submodule "submodules/externals/gsm"]
path = submodules/externals/gsm
url = git://git.linphone.org/gsm.git
[submodule "submodules/externals/speex"]
path = submodules/externals/speex
url = git://git.linphone.org/speex
url = git://git.linphone.org/speex.git
[submodule "submodules/msilbc"]
path = submodules/msilbc
url = git://git.linphone.org/msilbc.git
@ -30,7 +30,7 @@
ignore = dirty
[submodule "submodules/msamr"]
path = submodules/msamr
url = git://git.linphone.org/msamr
url = git://git.linphone.org/msamr.git
[submodule "submodules/externals/libvpx"]
path = submodules/externals/libvpx
url = https://chromium.googlesource.com/webm/libvpx
@ -52,13 +52,13 @@
url = git://git.linphone.org/bcg729.git
[submodule "submodules/belle-sip"]
path = submodules/belle-sip
url = git://git.linphone.org/belle-sip
url = git://git.linphone.org/belle-sip.git
[submodule "submodules/externals/antlr3"]
path = submodules/externals/antlr3
url = git://git.linphone.org/antlr3.git
[submodule "submodules/externals/libxml2"]
path = submodules/externals/libxml2
url = git://git.gnome.org/libxml2
url = git://git.gnome.org/libxml2.git
[submodule "submodules/externals/libupnp"]
path = submodules/externals/libupnp
url = git://git.linphone.org/libupnp.git
@ -73,7 +73,7 @@
url = git://git.linphone.org/polarssl.git
[submodule "submodules/externals/opus"]
path = submodules/externals/opus
url = git://git.opus-codec.org/opus.git
url = git://git.linphone.org/opus.git
[submodule "submodules/mswebrtc"]
path = submodules/mswebrtc
url = git://git.linphone.org/mswebrtc.git

2
README
View file

@ -9,7 +9,7 @@ To build liblinphone for Android, you must:
-------------------------------------------
0) download the Android sdk with platform-tools and tools updated to latest revision (at least API 16 is needed), then add both 'tools' and 'platform-tools' folders in your path.
1) download the Android ndk (=r10c) from google and add it to your path (no symlink !!!).
2) install yasm, nasm, curl, ant, rsync and the autotools: autoconf, automake, aclocal, libtoolize, pkgconfig
2) install yasm, nasm, curl, ant, rsync, autoconf, automake, aclocal, libtool, pkgconfig, bc, perl-LWP-Protocol-https, patch, vim-common
On 64 bits linux systems you'll need the ia32-libs package
With the latest Debian (multiarch), you need this:
dpkg --add-architecture i386

View file

@ -43,6 +43,7 @@
<resourcecontains resource="${output.file}" substring="longMsg=junit.framework.AssertionFailedError: View with id: '" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.RuntimeException:" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.NullPointerException:" />
<resourcecontains resource="${output.file}" substring="android.util.AndroidException: INSTRUMENTATION_FAILED:" />
</or>
</condition>
<exec executable="bash" unless:set="has.crashed">

View file

@ -23,9 +23,10 @@ public class LogsActivity extends Activity {
@Override
public void run() {
String path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String res_path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String write_path = mLogsActivity.getCacheDir().getPath();
tester = new TesterLogger(mLogsActivity);
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--config", path}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path}));
list.addAll(Arrays.asList(mArgs));
String[] array = list.toArray(new String[list.size()]);
tester.run(array);
@ -37,7 +38,7 @@ public class LogsActivity extends Activity {
});
}
}
private static String join(String [] array, String separator) {
String ret = "";
for(int i = 0; i < array.length; ++i) {
@ -48,7 +49,7 @@ public class LogsActivity extends Activity {
}
return ret;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -75,7 +76,7 @@ public class LogsActivity extends Activity {
getMenuInflater().inflate(R.menu.activity_logs, menu);
return true;
}
public void addLog(int level, String message) {
mLogs += message;
((TextView)findViewById(R.id.textView1)).append(message);
@ -86,7 +87,7 @@ public class LogsActivity extends Activity {
finish();
}
}
public void done() {
}
}

View file

@ -16,28 +16,28 @@ public class TestUnit extends AndroidTestCase {
private String mSuite;
private String mTest;
static Boolean isAssetCopied=false;
public TestUnit(String suite, String test) {
mSuite = suite;
mTest = test;
setName(suite + "/" + test);
}
public TestUnit(String name) {
String[] tab = name.split("/");
String[] tab = name.split("/");
mSuite = tab[0];
mTest = tab[1];
setName(name);
}
static public void copyAssetsFromPackage(Context ctx) throws IOException {
copyAssetsFromPackage(ctx,"config_files");
}
public static void copyAssetsFromPackage(Context ctx,String fromPath) throws IOException {
new File(ctx.getFilesDir().getPath()+"/"+fromPath).mkdir();
for (String f :ctx.getAssets().list(fromPath)) {
String current_name=fromPath+"/"+f;
InputStream lInputStream;
@ -50,8 +50,8 @@ public class TestUnit extends AndroidTestCase {
continue;
}
FileOutputStream lOutputStream = new FileOutputStream(new File(ctx.getFilesDir().getPath()+"/"+current_name));//ctx.openFileOutput (fromPath+"/"+f, 0);
int readByte;
byte[] buff = new byte[8048];
while (( readByte = lInputStream.read(buff)) != -1) {
@ -75,13 +75,15 @@ public class TestUnit extends AndroidTestCase {
protected void tearDown() throws Exception {
super.tearDown();
}
@Override
protected void runTest() {
String path = getContext().getFilesDir().getPath()+"/config_files";
String res_path = getContext().getFilesDir().getPath()+"/config_files";
String write_path = getContext().getCacheDir().getPath();
Tester tester = new Tester();
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--config", path, "--suite", mSuite, "--test", mTest}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path, "--suite", mSuite, "--test", mTest}));
String[] array = list.toArray(new String[list.size()]);
Assert.assertTrue(tester.run(array) == 0);
}
}
}

View file

@ -113,29 +113,33 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
if (externalBodyUrl != null || fileTransferContent != null) {
Button download = (Button) view.findViewById(R.id.download);
ImageView imageView = (ImageView) view.findViewById(R.id.image);
String appData = message.getAppData();
if (appData == null || (!LinphoneManager.getInstance().isMessagePending(nativeMessage) &&
!nativeMessage.isOutgoing() && appData.contains(context.getString(R.string.temp_photo_name_with_date).split("%s")[0]))) {
if(appData != null && !LinphoneManager.getInstance().isMessagePending(nativeMessage) &&
!nativeMessage.isOutgoing() && appData.contains(context.getString(R.string.temp_photo_name_with_date).split("%s")[0])){
appData = null;
}
if (appData == null ){
LinphoneManager.addListener(this);
download.setVisibility(View.VISIBLE);
download.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
v.setEnabled(false);
spinner.setVisibility(View.VISIBLE);
v.setVisibility(View.GONE);
String filename = context.getString(R.string.temp_photo_name_with_date).replace("%s", String.valueOf(System.currentTimeMillis()));
File file = new File(Environment.getExternalStorageDirectory(), filename);
nativeMessage.setListener(LinphoneManager.getInstance());
nativeMessage.setFileTransferFilepath(file.getPath());
nativeMessage.downloadFile();
nativeMessage.setAppData(filename);
LinphoneManager.getInstance().addDownloadMessagePending(nativeMessage);
}
});
} else {
if(LinphoneManager.getInstance().isMessagePending(nativeMessage)){
download.setVisibility(View.VISIBLE);
download.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
v.setEnabled(false);
v.setVisibility(View.GONE);
spinner.setVisibility(View.VISIBLE);
String filename = context.getString(R.string.temp_photo_name_with_date).replace("%s", String.valueOf(System.currentTimeMillis()));
File file = new File(Environment.getExternalStorageDirectory(), filename);
nativeMessage.setAppData(filename);
LinphoneManager.getInstance().addDownloadMessagePending(nativeMessage);
nativeMessage.setListener(LinphoneManager.getInstance());
nativeMessage.setFileTransferFilepath(file.getPath());
nativeMessage.downloadFile();
}
});
} else {
if (LinphoneManager.getInstance().isMessagePending(nativeMessage)) {
LinphoneManager.addListener(this);
download.setEnabled(false);
ProgressBar spinner = (ProgressBar) view.findViewById(R.id.spinner);
@ -144,9 +148,10 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
} else {
LinphoneManager.removeListener(this);
imageView.setVisibility(View.VISIBLE);
download.setVisibility(View.GONE);
loadBitmap(appData, imageView);
}
}
}
} else {
TextView msgView = (TextView) view.findViewById(R.id.message);
if (msgView != null) {

@ -1 +1 @@
Subproject commit 91ae7c164d9d20fd36657943a0aba807b4dfeb4f
Subproject commit 1ced637855bb052f2475847c867f648338b84376

@ -1 +1 @@
Subproject commit 4a4f757f66b02cf8834fd8d7a939bf54b245ad7e
Subproject commit 253e1543f13576be66fb4ed5396c0b99eeb08fb4

@ -1 +1 @@
Subproject commit e7dd35efa0f0d250db66fadb11994b4f48e088b1
Subproject commit d3bd19d39ddeee28505c12b9013088d0c3a67204

View file

@ -35,6 +35,7 @@
<resourcecontains resource="${output.file}" substring="longMsg=junit.framework.AssertionFailedError: View with id: '" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.RuntimeException:" />
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.NullPointerException:" />
<resourcecontains resource="${output.file}" substring="android.util.AndroidException: INSTRUMENTATION_FAILED:" />
</or>
</condition>
<exec executable="bash" unless:set="has.crashed">