Skip to content

Commit

Permalink
#108 fixes uri crash (#122)
Browse files Browse the repository at this point in the history
* #108 fixes uri crash

* little cleaning
  • Loading branch information
Grigoriym authored May 11, 2024
1 parent 7ace83b commit 16f4925
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.grappim.hateitorrateit.utils.file.urimanager

import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.core.content.FileProvider
import com.grappim.hateitorrateit.utils.HashUtils
Expand Down Expand Up @@ -30,11 +29,6 @@ class FileUriManagerImpl @Inject constructor(
folderName: String,
isEdit: Boolean
): ImageData {
context.contentResolver.takePersistableUriPermission(
uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION
)

val folder = if (isEdit) {
folderPathManager.getTempFolderName(folderName)
} else {
Expand All @@ -45,7 +39,7 @@ class FileUriManagerImpl @Inject constructor(
val newFile = fileCreationUtils.createFileLocally(uri, folder)
val newUri = getFileUri(newFile)
val fileSize = fileInfoRetriever.getFileSize(newUri)
val mimeType = fileInfoRetriever.getMimeType(uri)
val mimeType = fileInfoRetriever.getMimeType(newUri)
return ImageData(
uri = newUri,
name = newFile.name,
Expand Down

0 comments on commit 16f4925

Please sign in to comment.