mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Drop the MediaStore explanation from the save helper
Review feedback: the retry itself is short enough to read, and the platform limit it works around belongs in the commit, not the source. The contract of the name helper keeps its one-line KDoc.
This commit is contained in:
-9
@@ -55,15 +55,6 @@ fun String.withFileNameSuffix(suffix: String): String {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs [saveAs] with [fileName], and runs it once more with a suffixed name if the platform failed to
|
||||
* build a unique name for it.
|
||||
*
|
||||
* `MediaStore` de-duplicates the display name of a new file itself, but gives up after 32 conflicts
|
||||
* and throws `IllegalStateException("Failed to build unique file")`, which makes saving a file with a
|
||||
* common name such as `image.png` fail for good.
|
||||
* See https://github.com/element-hq/element-x-android/issues/6371
|
||||
*/
|
||||
fun <T> saveWithUniqueFileName(
|
||||
fileName: String,
|
||||
uniqueSuffix: () -> String = { "_${System.currentTimeMillis()}" },
|
||||
|
||||
Reference in New Issue
Block a user