diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-09-21 18:20:53 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-09-21 18:20:53 +0200 |
commit | 13ed27f91ed6ac29a8f0524467599fb4ec0080bc (patch) | |
tree | 0b8e16f7909346378d1aa3a2f9105329cdcc8004 /src | |
parent | 401759cdc7e4ff90745b891ffa460d2112182aa2 (diff) |
don't use file provider for photo uris on android < N. fixes #2030
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) { |