googlesamples / easypermissions

Simplify Android M system permissions
https://firebaseopensource.com/projects/googlesamples/easypermissions/
Apache License 2.0
9.86k stars 1.46k forks source link

A bug has occurred #282

Closed hyhyhykw closed 5 years ago

hyhyhykw commented 5 years ago

Basic Information

Device type: Mi8 Lite OS version: 9.0 EasyPermissions version: 3.0.0 (androidx)

Describe the problem

When I authorized, manually close the permissions, when I applied again, I clicked the Reject button and executed the onPermissionsGranted method.

Code and logs

private void requestPermission(){
String[] perms = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};
        if (EasyPermissions.hasPermissions(this, perms)) {
            requestCamera();
        } else {
            List<String> permissionNames = Permission.transformText(this, perms);
            String message = getString(R.string.picker_message_permission_rationale, TextUtils.join("\n", permissionNames));
            EasyPermissions.requestPermissions(
                    this,
                    message,
                    RC_CAMERA_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA);
        }
}

    @Override
    public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
        requestCamera();
    }
hyhyhykw commented 5 years ago

Sorry,I am careless.You can close it