When handling a plain text share intent, check if it contains Uris before handling its content.
This commit is contained in:
parent
16e4c93729
commit
01fc964cb6
1 changed files with 2 additions and 2 deletions
|
|
@ -58,8 +58,9 @@ class DefaultShareIntentHandler(
|
|||
onPlainText: suspend (String) -> Boolean,
|
||||
): Boolean {
|
||||
val type = intent.resolveType(context) ?: return false
|
||||
val uris = getIncomingUris(intent, type)
|
||||
return when {
|
||||
type == MimeTypes.PlainText -> handlePlainText(intent, onPlainText)
|
||||
uris.isEmpty() && type == MimeTypes.PlainText -> handlePlainText(intent, onPlainText)
|
||||
type.isMimeTypeImage() ||
|
||||
type.isMimeTypeVideo() ||
|
||||
type.isMimeTypeAudio() ||
|
||||
|
|
@ -67,7 +68,6 @@ class DefaultShareIntentHandler(
|
|||
type.isMimeTypeFile() ||
|
||||
type.isMimeTypeText() ||
|
||||
type.isMimeTypeAny() -> {
|
||||
val uris = getIncomingUris(intent, type)
|
||||
val result = onUris(uris)
|
||||
revokeUriPermissions(uris.map { it.uri })
|
||||
result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue