From 13ed27f91ed6ac29a8f0524467599fb4ec0080bc Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 21 Sep 2016 18:20:53 +0200 Subject: [PATCH] don't use file provider for photo uris on android < N. fixes #2030 --- .../eu/siacs/conversations/persistance/FileBackend.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 8fcda7c24..20fe0625c 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -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) {