diff --git a/saved-sites/saved-sites-impl/src/main/java/com/duckduckgo/savedsites/impl/service/SavedSitesExporter.kt b/saved-sites/saved-sites-impl/src/main/java/com/duckduckgo/savedsites/impl/service/SavedSitesExporter.kt index 8c35bd2fa1ce..28665ee44a94 100644 --- a/saved-sites/saved-sites-impl/src/main/java/com/duckduckgo/savedsites/impl/service/SavedSitesExporter.kt +++ b/saved-sites/saved-sites-impl/src/main/java/com/duckduckgo/savedsites/impl/service/SavedSitesExporter.kt @@ -58,7 +58,8 @@ class RealSavedSitesExporter( if (content.isEmpty()) { return ExportSavedSitesResult.NoSavedSitesExported } - val file = contentResolver.openFileDescriptor(uri, "w") + // "w" mode does not truncate on Android 10/11, use "rwt" mode workaround - https://issuetracker.google.com/issues/180526528 + val file = contentResolver.openFileDescriptor(uri, "rwt") if (file != null) { val fileOutputStream = FileOutputStream(file.fileDescriptor) fileOutputStream.write(content.toByteArray())