pull/2718/head
kunfei 2 years ago
parent f64d95d3a2
commit aaa2a061f9
  1. 10
      app/src/main/java/io/legado/app/lib/permission/Request.kt

@ -119,15 +119,13 @@ internal class Request : OnRequestPermissionsResultCallback {
} }
fun getDeniedPermissions(permissions: Array<String>?): Array<String>? { fun getDeniedPermissions(permissions: Array<String>?): Array<String>? {
val context = source?.context ?: return permissions
if (permissions != null) { if (permissions != null) {
val deniedPermissionList = ArrayList<String>() val deniedPermissionList = ArrayList<String>()
for (permission in permissions) { for (permission in permissions) {
if (source?.context?.let { if (
ContextCompat.checkSelfPermission( ContextCompat.checkSelfPermission(context, permission)
it, != PackageManager.PERMISSION_GRANTED
permission
)
} != PackageManager.PERMISSION_GRANTED
) { ) {
deniedPermissionList.add(permission) deniedPermissionList.add(permission)
} }

Loading…
Cancel
Save