guolindev / PermissionX

An open source Android library that makes handling runtime permissions extremely easy.
Apache License 2.0
3.53k stars 406 forks source link

PermissionX.isGranted(mContext, it) 是不是没法用来判断特殊权限是否已经申请到?比如MANAGE_EXTERNAL_STORAGE #252

Open jamgudev opened 1 year ago

jamgudev commented 1 year ago

版本如下:implementation 'com.guolindev.permissionx:permissionx:1.7.1' 我想用 PermissionX.isGranted(mContext, it) 判断特殊权限是否已经申请,但一直返回false,实际上该特殊权限我已经申请过了。 我看内部实现也是直接调用的: ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED;

想问下郭神有想法适配一下特殊权限是否已经申请到的判断吗?拓展一下PermissionX.isGranted()的用法?

pengguanming commented 4 months ago

Environment.isExternalStorageManager()来检测是否可以拥有MANAGE_EXTERNAL_STORAGE,请参考https://ourcodeworld.com/articles/read/1559/how-does-manage-external-storage-permission-work-in-android