mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-01 15:23:54 +01:00
add condition to check for partial access on API >= 34
It prevents invoking photo picker on UploadActivity.
This commit is contained in:
parent
75afe059a6
commit
8b58b4367d
2 changed files with 5 additions and 2 deletions
|
|
@ -278,7 +278,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
|
|||
public void checkStoragePermissions() {
|
||||
// Check if all required permissions are granted
|
||||
final boolean hasAllPermissions = PermissionUtils.hasPermission(this, PERMISSIONS_STORAGE);
|
||||
if (hasAllPermissions) {
|
||||
final boolean hasPartialAccess = PermissionUtils.hasPartialAccess(this);
|
||||
if (hasAllPermissions || hasPartialAccess) {
|
||||
// All required permissions are granted, so enable UI elements and perform actions
|
||||
receiveSharedItems();
|
||||
binding.cvContainerTopCard.setVisibility(View.VISIBLE);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,9 @@ public class PermissionUtils {
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
return ContextCompat.checkSelfPermission(activity,
|
||||
permission.READ_MEDIA_VISUAL_USER_SELECTED
|
||||
) == PackageManager.PERMISSION_GRANTED;
|
||||
) == PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(
|
||||
activity, permission.READ_MEDIA_IMAGES
|
||||
) == PackageManager.PERMISSION_DENIED;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue