mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-26 08:27:46 +01:00
do not require the Storage Permission at handling third party intents
This commit is contained in:
parent
63b28403bc
commit
2f23c18e94
@ -204,18 +204,14 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
|||||||
|
|
||||||
private fun checkIntents() {
|
private fun checkIntents() {
|
||||||
if (intent?.action == Intent.ACTION_SEND && intent.type?.startsWith("image/") == true) {
|
if (intent?.action == Intent.ACTION_SEND && intent.type?.startsWith("image/") == true) {
|
||||||
getStoragePermission {
|
|
||||||
val uri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)
|
val uri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)
|
||||||
tryOpenUri(uri, intent)
|
tryOpenUri(uri, intent)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intent?.action == Intent.ACTION_SEND_MULTIPLE && intent.type?.startsWith("image/") == true) {
|
if (intent?.action == Intent.ACTION_SEND_MULTIPLE && intent.type?.startsWith("image/") == true) {
|
||||||
getStoragePermission {
|
|
||||||
val imageUris = intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)
|
val imageUris = intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)
|
||||||
imageUris.any { tryOpenUri(it, intent) }
|
imageUris.any { tryOpenUri(it, intent) }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
|
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
|
||||||
getStoragePermission {
|
getStoragePermission {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user