mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Documentation added to explain creating a cache file.
This commit is contained in:
parent
4349331ee7
commit
c5d2a34ebd
1 changed files with 4 additions and 0 deletions
|
@ -161,6 +161,10 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
|
|||
var uploadedFileEncryptedFileInfo: EncryptedFileInfo? = null
|
||||
|
||||
return try {
|
||||
// Compressor library works with File instead of Uri for now. Since Scoped Storage doesn't allow us to access files directly, we should copy
|
||||
// it to a cache folder by using InputStream and OutputStream.
|
||||
// https://github.com/zetbaitsu/Compressor/pull/150
|
||||
// As soon as the above PR is merged, we can use attachment.queryUri instead of creating a cacheFile.
|
||||
var cacheFile = File.createTempFile(attachment.name ?: UUID.randomUUID().toString(), ".jpg", context.cacheDir)
|
||||
cacheFile.parentFile?.mkdirs()
|
||||
if (cacheFile.exists()) {
|
||||
|
|
Loading…
Reference in a new issue