From ee3ae77e49424751e3d7f78fad70aa0e93c4bdd8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Nov 2017 16:41:18 +0100 Subject: [PATCH] ensure getFilePublicUri uses the fileprovider pattern --- .../com/simplemobiletools/commons/extensions/Context.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt index b18169287..fd8ebc581 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt @@ -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") {