ensure getFilePublicUri uses the fileprovider pattern

This commit is contained in:
tibbi 2017-11-06 16:41:18 +01:00
parent 866c2ff8ba
commit ee3ae77e49

View file

@ -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") {