ensure getFilePublicUri uses the fileprovider pattern
This commit is contained in:
parent
866c2ff8ba
commit
ee3ae77e49
1 changed files with 1 additions and 7 deletions
|
@ -218,13 +218,7 @@ fun Context.getPermissionString(id: Int) = when (id) {
|
|||
else -> ""
|
||||
}
|
||||
|
||||
fun Context.getFilePublicUri(file: File, applicationId: String): Uri {
|
||||
return if (isNougatPlus()) {
|
||||
FileProvider.getUriForFile(this, "$applicationId.provider", file)
|
||||
} else {
|
||||
Uri.fromFile(file)
|
||||
}
|
||||
}
|
||||
fun Context.getFilePublicUri(file: File, applicationId: String) = FileProvider.getUriForFile(this, "$applicationId.provider", file)
|
||||
|
||||
fun Context.getFilenameFromUri(uri: Uri): String {
|
||||
return if (uri.scheme == "file") {
|
||||
|
|
Loading…
Reference in a new issue