Merge branch 'master' into dev_group_chat

This commit is contained in:
Sylvain Berfini 2017-10-31 10:36:50 +01:00
commit 7b30c40a98
8 changed files with 89 additions and 40 deletions

View file

@ -2,8 +2,8 @@
<manifest package="org.linphone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3284"
android:versionName="3.2.8">
android:versionCode="3303"
android:versionName="3.3.0">
<uses-sdk
android:minSdkVersion="16"

View file

@ -2,8 +2,8 @@
<manifest package="org.linphone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3284"
android:versionName="3.2.8">
android:versionCode="3303"
android:versionName="3.3.0">
<uses-sdk
android:minSdkVersion="16"

View file

@ -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

View file

@ -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:+'
@ -84,7 +84,7 @@ excludePackage.add('**/LICENSE.txt')
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "26.0.2"
buildToolsVersion "26.0.1"
applicationId getPackageName()
multiDexEnabled true
@ -158,8 +158,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

View file

@ -191,6 +191,7 @@
<string name="displayed">Read</string>
<string name="delivered">Delivered</string>
<string name="resend">Resend</string>
<string name="error_opening_file">An error occurs when opening this file.</string>
<string name="conversation_information">Infos</string>
<string name="administrator">Admin</string>
<string name="conversation_subject_hint">Name your group</string>

View file

@ -133,7 +133,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){
@ -141,19 +141,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()) {

View file

@ -170,7 +170,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.isAccountExist();
loadAccountCreator(cfg).isAccountExist();
} else {
success();
}
@ -226,6 +226,24 @@ private static AssistantActivity instance;
status = fragment;
}
private AccountCreator loadAccountCreator(ProxyConfig cfg) {
AccountCreator accountCreator = LinphoneManager.getLc().createAccountCreator(LinphonePreferences.instance().getXmlrpcUrl());
ProxyConfig 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);

View file

@ -768,7 +768,7 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
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", "-");
@ -801,7 +801,7 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
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")) {
@ -1584,20 +1584,29 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
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);
}
});
}
@ -1749,20 +1758,29 @@ public class ChatFragment extends Fragment implements OnClickListener, ChatMessa
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);
}
}
});
}