From 09b6be1cdee9a8306b5f13011d4f4a3fccb4bc05 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 19 Oct 2017 11:35:57 +0200 Subject: [PATCH 1/5] Update changelog --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea336dee2..26e8b01c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,14 +12,20 @@ Group changes to describe their impact on the project, as follows: ## [Incomming] -## [3.2.8] +## [3.3.0] - 2017-10-18 ### Added -- File sharing +- Integration with Android O +- New video adaptive bitrate algorithm(More informations [here](https://wiki.linphone.org/xwiki/wiki/public/view/FAQ/How%20does%20adaptive%20bitrate%20algorithm%20work%20%3F/)) + +### Changed +- Application is no more managing in-call wakelock, it's now managed by the library ### Fixed - Crashs in new chat view - Contacts management +- Random crash in chatroom +- Improve chats list loading time ## [3.2.7] - 2017-05-15 From e28abd853fabb1b70871bfafb46f64dcd306140b Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 19 Oct 2017 11:36:06 +0200 Subject: [PATCH 2/5] Update build.gradle --- build.gradle | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index bcd525310..f07d012aa 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.3' if (googleFile.exists()) { - classpath 'com.google.gms:google-services:3.1.0' + classpath 'com.google.gms:google-services:3.+' } } } @@ -45,7 +45,7 @@ dependencies { androidTestCompile 'junit:junit:+' compile 'org.apache.commons:commons-compress:+' if (firebaseEnable()) { - compile 'com.google.firebase:firebase-messaging:11.4.0' + compile 'com.google.firebase:firebase-messaging:11.+' } else { compile fileTree(include: 'gcm.jar', dir: 'libs') compile 'com.android.support:support-v4:+' @@ -87,7 +87,7 @@ excludePackage.add('**/LICENSE.txt') android { defaultConfig { compileSdkVersion 26 - buildToolsVersion "26.0.2" + buildToolsVersion "26.0.1" applicationId getPackageName() multiDexEnabled true @@ -161,8 +161,10 @@ android { debug.setRoot('build-types/debug') release.setRoot('build-types/release') } - compileSdkVersion 26 - buildToolsVersion '26.0.1' + packagingOptions { + pickFirst 'META-INF/NOTICE' + pickFirst 'META-INF/LICENSE' + } } // Grant permissions From 9d8a5ee23260b52dea1e468eb94653dfbc096238 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 19 Oct 2017 15:13:27 +0200 Subject: [PATCH 3/5] Fix issue on login with the check of alias --- .../linphone/assistant/AssistantActivity.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/android/org/linphone/assistant/AssistantActivity.java b/src/android/org/linphone/assistant/AssistantActivity.java index 93ef61c93..90db60512 100644 --- a/src/android/org/linphone/assistant/AssistantActivity.java +++ b/src/android/org/linphone/assistant/AssistantActivity.java @@ -169,7 +169,7 @@ private static AssistantActivity instance; if (getResources().getBoolean(R.bool.use_phone_number_validation) && cfg.getDomain().equals(getString(R.string.default_domain)) && LinphoneManager.getLc().getDefaultProxyConfig() != null) { - accountCreator.isAccountUsed(); + loadAccountCreator(cfg).isAccountUsed(); } else { success(); } @@ -225,6 +225,27 @@ private static AssistantActivity instance; status = fragment; } + private LinphoneAccountCreator loadAccountCreator(LinphoneProxyConfig cfg) { + LinphoneAccountCreator accountCreator = + LinphoneCoreFactory.instance().createAccountCreator( + LinphoneManager.getLc(), + LinphonePreferences.instance().getXmlrpcUrl()); + LinphoneProxyConfig cfgTab[] = LinphoneManager.getLc().getProxyConfigList(); + accountCreator.setListener(this); + int n = -1; + for (int i = 0 ; i < cfgTab.length ; i++) { + if (cfgTab[i].equals(cfg)) { + n = i; + break; + } + } + if (n >= 0) { + accountCreator.setDomain(mPrefs.getAccountDomain(n)); + accountCreator.setUsername(mPrefs.getAccountUsername(n)); + } + return accountCreator; + } + private void initUI() { back = (ImageView) findViewById(R.id.back); back.setOnClickListener(this); From f34db59d07508d591579db3eb642513c921fe352 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 19 Oct 2017 15:17:36 +0200 Subject: [PATCH 4/5] Update version code --- AndroidManifest.xml | 4 ++-- AndroidManifestLibrary.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ae3a76605..d8865d06b 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="3303" + android:versionName="3.3.0"> + android:versionCode="3303" + android:versionName="3.3.0"> Date: Fri, 20 Oct 2017 11:28:57 +0200 Subject: [PATCH 5/5] [FileSharing] update files sharing to fix some issues + add new String error --- res/values/strings.xml | 1 + src/android/org/linphone/ChatFragment.java | 68 ++++++++++++------- .../linphone/LinphoneLauncherActivity.java | 10 ++- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6ba093432..592efc051 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -189,6 +189,7 @@ Read Delivered Resend + An error occurs when opening this file. Registered diff --git a/src/android/org/linphone/ChatFragment.java b/src/android/org/linphone/ChatFragment.java index eb97f330d..f1cc2f8a9 100644 --- a/src/android/org/linphone/ChatFragment.java +++ b/src/android/org/linphone/ChatFragment.java @@ -782,7 +782,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC private void sendImageMessage(String path, int imageSize) { if(path.contains("file://")) { - path = path.substring(7); + path = path.split("file:///", 2)[1]; } if(path.contains("%20")) { path = path.replace("%20", "-"); @@ -815,7 +815,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC private void sendFileSharingMessage(String path, int size ) { if (path.contains("file://")) { - path = path.substring(7); + path = path.split("file:///", 2)[1]; } else if (path.contains("com.android.contacts/contacts/")) { path = getCVSPathFromLookupUri(path).toString(); } else if (path.contains("vcard") || path.contains("vcf")) { @@ -1676,20 +1676,29 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC contentUri = Uri.parse(imageUri); } else { file = new File(imageUri); - contentUri = FileProvider.getUriForFile(getActivity(), "org.linphone.provider", file); + try { + contentUri = FileProvider.getUriForFile(getActivity(), "org.linphone.provider", file); + }catch(java.lang.IllegalArgumentException e){ + Log.e("Something wrong happend : "+e); + contentUri = null; + } } String type = null; - String extension = MimeTypeMap.getFileExtensionFromUrl(contentUri.toString()); - if (extension != null) { - type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if(contentUri != null) { + String extension = MimeTypeMap.getFileExtensionFromUrl(contentUri.toString()); + if (extension != null) { + type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + } + if (type != null) { + intent.setDataAndType(contentUri, type); + } else { + intent.setDataAndType(contentUri, "*/*"); + } + intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION); + context.startActivity(intent); + }else{ + LinphoneActivity.instance().displayCustomToast(getString(R.string.error_opening_file), Toast.LENGTH_LONG); } - if(type != null) { - intent.setDataAndType(contentUri, type); - }else { - intent.setDataAndType(contentUri, "*/*"); - } - intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION); - context.startActivity(intent); } }); } @@ -1901,20 +1910,29 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC contentUri = Uri.parse(imageUri); } else { file = new File(imageUri); - contentUri = FileProvider.getUriForFile(getActivity(), "org.linphone.provider", file); + try { + contentUri = FileProvider.getUriForFile(getActivity(), "org.linphone.provider", file); + }catch(java.lang.IllegalArgumentException e){ + Log.e("Something wrong happend : "+e); + contentUri = null; + } } String type = null; - String extension = MimeTypeMap.getFileExtensionFromUrl(contentUri.toString()); - if (extension != null) { - type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - } - if(type != null) { - intent.setDataAndType(contentUri, type); - }else { - intent.setDataAndType(contentUri, "*/*"); - } - intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION); - context.startActivity(intent); + if(contentUri != null) { + String extension = MimeTypeMap.getFileExtensionFromUrl(contentUri.toString()); + if (extension != null) { + type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + } + if (type != null) { + intent.setDataAndType(contentUri, type); + } else { + intent.setDataAndType(contentUri, "*/*"); + } + intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION); + context.startActivity(intent); + }else{ + LinphoneActivity.instance().displayCustomToast(getString(R.string.error_opening_file), Toast.LENGTH_LONG); + } } }); } diff --git a/src/android/org/linphone/LinphoneLauncherActivity.java b/src/android/org/linphone/LinphoneLauncherActivity.java index b9eebb084..9784bccfb 100644 --- a/src/android/org/linphone/LinphoneLauncherActivity.java +++ b/src/android/org/linphone/LinphoneLauncherActivity.java @@ -126,7 +126,7 @@ public class LinphoneLauncherActivity extends Activity { newIntent.setData(intent.getData()); if (Intent.ACTION_SEND.equals(action) && type != null) { if (type.contains("text/")){ - if(("text/plain").equals(type) && intent.getStringExtra(Intent.EXTRA_TEXT)!= null) { + if(("text/plain").equals(type) && (String)intent.getStringExtra(Intent.EXTRA_TEXT)!= null) { stringFileShared = intent.getStringExtra(Intent.EXTRA_TEXT); newIntent.putExtra("msgShared", stringFileShared); } else if(((Uri) intent.getExtras().get(Intent.EXTRA_STREAM)) != null){ @@ -134,19 +134,23 @@ public class LinphoneLauncherActivity extends Activity { newIntent.putExtra("fileShared", stringFileShared); } }else { - if(intent.getStringExtra(Intent.EXTRA_STREAM) != null){ + if(((String) intent.getStringExtra(Intent.EXTRA_STREAM)) != null){ stringUriFileShared = intent.getStringExtra(Intent.EXTRA_STREAM); }else { fileUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); stringUriFileShared = LinphoneUtils.getRealPathFromURI(getBaseContext(), fileUri); if(stringUriFileShared == null) - if(fileUri.getPath().contains("/0/1/mediakey:/local")) { + if(fileUri.getPath().contains("/0/1/mediakey:/local") || fileUri.getPath().contains("/ORIGINAL/NONE/")) { stringUriFileShared = LinphoneUtils.getFilePath(getBaseContext(), fileUri); }else stringUriFileShared = fileUri.getPath(); } newIntent.putExtra("fileShared", stringUriFileShared); } + }else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) { + if (type.startsWith("image/")) { + //TODO : Manage multiple files sharing + } }else if( ACTION_CALL_LINPHONE.equals(action) && (intent.getStringExtra("NumberToCall") != null)) { String numberToCall = intent.getStringExtra("NumberToCall"); if (CallActivity.isInstanciated()) {