remove the special OTG handling at ensurePublicUri
This commit is contained in:
parent
06abb1d8b9
commit
f509c8968c
2 changed files with 7 additions and 11 deletions
|
@ -7,7 +7,7 @@ buildscript {
|
|||
propMinSdkVersion = 21
|
||||
propTargetSdkVersion = propCompileSdkVersion
|
||||
propVersionCode = 1
|
||||
propVersionName = '5.8.0'
|
||||
propVersionName = '5.8.1'
|
||||
kotlin_version = '1.3.21'
|
||||
}
|
||||
|
||||
|
|
|
@ -302,17 +302,13 @@ fun Context.getMimeTypeFromUri(uri: Uri): String {
|
|||
}
|
||||
|
||||
fun Context.ensurePublicUri(path: String, applicationId: String): Uri? {
|
||||
return if (isPathOnOTG(path)) {
|
||||
getDocumentFile(path)?.uri
|
||||
val uri = Uri.parse(path)
|
||||
return if (uri.scheme == "content") {
|
||||
uri
|
||||
} else {
|
||||
val uri = Uri.parse(path)
|
||||
if (uri.scheme == "content") {
|
||||
uri
|
||||
} else {
|
||||
val newPath = if (uri.toString().startsWith("/")) uri.toString() else uri.path
|
||||
val file = File(newPath)
|
||||
getFilePublicUri(file, applicationId)
|
||||
}
|
||||
val newPath = if (uri.toString().startsWith("/")) uri.toString() else uri.path
|
||||
val file = File(newPath)
|
||||
getFilePublicUri(file, applicationId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue