don't use file provider for photo uris on android < N. fixes #2030

This commit is contained in:
Daniel Gultsch 2016-09-21 18:20:53 +02:00
parent 401759cdc7
commit 13ed27f91e

View file

@ -440,7 +440,11 @@ public class FileBackend {
pathBuilder.append("IMG_" + this.imageDateFormat.format(new Date()) + ".jpg");
File file = new File(pathBuilder.toString());
file.getParentFile().mkdirs();
return FileProvider.getUriForFile(mXmppConnectionService,"eu.siacs.conversations.files",file);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(mXmppConnectionService, "eu.siacs.conversations.files", file);
} else {
return Uri.fromFile(file);
}
}
public Avatar getPepAvatar(Uri image, int size, Bitmap.CompressFormat format) {