diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 8fcda7c2..20fe0625 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) { |