mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Bypassed Storage Perms Check for External Share
The share intent provides files via content uris with temporary read permissions, so we do not need to obtain storage permissions
This commit is contained in:
parent
63f621cb56
commit
d51ddb989d
1 changed files with 10 additions and 0 deletions
|
|
@ -314,6 +314,16 @@ class UploadActivity : BaseActivity(), UploadContract.View, UploadBaseFragment.C
|
|||
// Check if all required permissions are granted
|
||||
val hasAllPermissions = hasPermission(this, PERMISSIONS_STORAGE)
|
||||
val hasPartialAccess = hasPartialAccess(this)
|
||||
|
||||
// The share intent provides files via content uris with temporary read permissions,
|
||||
// so we do not need to obtain storage permissions
|
||||
val intent = intent
|
||||
val action = intent.action
|
||||
if (Intent.ACTION_SEND == action || Intent.ACTION_SEND_MULTIPLE == action) {
|
||||
receiveSharedItems()
|
||||
return
|
||||
}
|
||||
|
||||
if (hasAllPermissions || hasPartialAccess) {
|
||||
// All required permissions are granted, so enable UI elements and perform actions
|
||||
receiveSharedItems()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue