Merge branch 'fixDownload' into 'develop'

Fix Download bug in Custom Locations

See merge request ultrasonic/ultrasonic!847
This commit is contained in:
birdbird 2022-10-04 09:29:10 +00:00
commit c93ef240b4

View File

@ -87,14 +87,10 @@ class StorageFile(
override fun getFileOutputStream(append: Boolean): OutputStream {
val mode = if (append) "wa" else "w"
val descriptor = UApp.applicationContext().contentResolver.openAssetFileDescriptor(
return UApp.applicationContext().contentResolver.openOutputStream(
uri,
mode
)
val stream = descriptor?.createOutputStream()
?: throw IOException("Couldn't retrieve OutputStream")
descriptor.close()
return stream
) ?: throw IOException("Couldn't retrieve OutputStream")
}
override fun getFileInputStream(): InputStream {