Truncate files when writing to them explicitly
For some reason this wasn't an issue on Pie, but an instrumentation test caught the change in behavior on Q.
This commit is contained in:
parent
e659892278
commit
bf28bc3338
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ class DocumentsStorage(private val context: Context, storage: Storage?, token: L
|
|||
|
||||
@Throws(IOException::class)
|
||||
fun getOutputStream(file: DocumentFile): OutputStream {
|
||||
return context.contentResolver.openOutputStream(file.uri) ?: throw IOException()
|
||||
return context.contentResolver.openOutputStream(file.uri, "wt") ?: throw IOException()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue