Change summary
  src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 2 
src/main/res/xml/file_paths.xml                                   | 8 
2 files changed, 8 insertions(+), 2 deletions(-)
  Detailed changes
  
  
    
    @@ -238,7 +238,7 @@ public class FileBackend {
     }
 
     public static Uri getUriForFile(Context context, File file) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N || Config.ONLY_INTERNAL_STORAGE) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N || Config.ONLY_INTERNAL_STORAGE || file.toString().startsWith(context.getCacheDir().toString())) {
             try {
                 return FileProvider.getUriForFile(context, getAuthority(context), file);
             } catch (IllegalArgumentException e) {
  
  
  
    
    @@ -21,4 +21,10 @@
     <cache-path
         name="camera"
         path="Camera/"/>
-</paths>
+    <cache-path
+        name="cache_media"
+        path="media/"/>
+    <cache-path
+        name="avatars"
+        path="avatars/"/>
+</paths>