|
|
|
@ -1,11 +1,9 @@ |
|
|
|
|
package io.legado.app.help.permission |
|
|
|
|
|
|
|
|
|
import android.os.Build |
|
|
|
|
import androidx.annotation.StringRes |
|
|
|
|
import androidx.appcompat.app.AppCompatActivity |
|
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
|
import org.jetbrains.anko.startActivity |
|
|
|
|
import java.util.ArrayList |
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
class PermissionsCompat private constructor() { |
|
|
|
|
|
|
|
|
@ -18,7 +16,7 @@ class PermissionsCompat private constructor() { |
|
|
|
|
companion object { |
|
|
|
|
// 检查权限, 如果已经拥有返回 true |
|
|
|
|
fun check(activity: AppCompatActivity, vararg permissions: String): Boolean { |
|
|
|
|
var request: Request = Request(activity) |
|
|
|
|
var request = Request(activity) |
|
|
|
|
var pers = ArrayList<String>() |
|
|
|
|
pers.addAll(listOf(*permissions)) |
|
|
|
|
var data = request.getDeniedPermissions(pers.toTypedArray()) |
|
|
|
|