Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]:Android 14 对部分照片和视频进行访问授权异常问题 #323

Open
LaiYin9 opened this issue Sep 19, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@LaiYin9
Copy link

LaiYin9 commented Sep 19, 2024

Framework Version [Required]

20.0

Issue Description [Required]

申请多个权限
XXPermissions.with(this)
.permission(Manifest.permission.CAMERA)
.permission(Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED)
.permission(Manifest.permission.READ_MEDIA_IMAGES).interceptor(new PermissionInterceptor()).request(new OnPermissionCallback() {

            @Override
            public void onGranted(@NonNull List<String> permissions, boolean allGranted) {
                if (!allGranted) {
                    return;
                }
                toast(String.format(getString(R.string.demo_obtain_permission_success_hint), PermissionNameConvert.getPermissionNames(MainActivity.this, permissions)));
            }

            @Override
            public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) {
                OnPermissionCallback.super.onDenied(permissions, doNotAskAgain);
                Log.e("onDenied", permissions.toString() + "----" + doNotAskAgain);
            }
        });

Steps to Reproduce [Required]

在Android 14 小米手机上,申请多个权限。当我相机权限申请通过后。申请照片和视频权限时,提示
1、选择照片和视频
2、全部允许
3、不选择其他数据
点击选择照片和视频,允许某个照片后,onGranted返回申请成功。
第二次点击按钮申请权限,还是会弹出系统弹窗。申请权限,点击拒绝 onGranted 返回申请成功。
理论上讲,当我点击拒绝时,权限申请应返回失败

Is the Issue Reproducible? [Required]

Not Selected

Project targetSdkVersion [Required]

34

Device Information [Required]

小米 Xiaomi MIX Flip

Android Version [Required]

Android 14

Issue Source Channel [Required]

Encountered by myself

Is it specific to certain device models? [Required]

Android 14

Does the latest version of the framework have this issue? [Required]

Yes

Is the issue mentioned in the framework documentation? [Required]

No

Did you consult the framework documentation but couldn't find a solution? [Required]

Yes

Has a similar issue been reported in the issue list? [Required]

No

Have you searched the issue list but couldn't find a solution? [Required]

Yes

Can the issue be reproduced with a demo project? [Required]

Yes

Provide Error Stack Trace

No response

Provide Screenshots or Videos

default.mp4
default.mp4

Provide a Solution

No response

@LaiYin9 LaiYin9 added the bug Something isn't working label Sep 19, 2024
@getActivity
Copy link
Owner

这是因为你之前已经授权了部分照片访问,所以拒绝这一次的权限并不会影响上次已经授权部分访问的照片。

@LaiYin9
Copy link
Author

LaiYin9 commented Sep 22, 2024

当用户给了部分权限后,再次申请权限,这时用户点击了拒绝后,由于在权限回调中检测到已经有了部分权限后所以会返回已经有权限了,可用户点击的是拒绝,这种情况有好的解决办法吗?

@getActivity
Copy link
Owner

你用原生的 API 申请权限也是这样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants