|
|
@ -14,8 +14,7 @@ import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
internal class Request : OnRequestPermissionsResultCallback { |
|
|
|
internal class Request : OnRequestPermissionsResultCallback { |
|
|
|
|
|
|
|
|
|
|
|
var startTime: Long = 0 |
|
|
|
val startTime: Long |
|
|
|
private set |
|
|
|
|
|
|
|
private var requestCode: Int = 0 |
|
|
|
private var requestCode: Int = 0 |
|
|
|
private var source: RequestSource? = null |
|
|
|
private var source: RequestSource? = null |
|
|
|
private var permissions: ArrayList<String>? = null |
|
|
|
private var permissions: ArrayList<String>? = null |
|
|
@ -28,22 +27,17 @@ internal class Request : OnRequestPermissionsResultCallback { |
|
|
|
|
|
|
|
|
|
|
|
private val deniedPermissions: Array<String>? |
|
|
|
private val deniedPermissions: Array<String>? |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
val permissions: Array<String>? |
|
|
|
return getDeniedPermissions(this.permissions?.toTypedArray()) |
|
|
|
val size = this.permissions?.size ?: 0 |
|
|
|
|
|
|
|
if (size > 0) { |
|
|
|
|
|
|
|
permissions = this.permissions?.toTypedArray() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
permissions = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getDeniedPermissions(permissions) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
constructor(activity: AppCompatActivity) { |
|
|
|
constructor(activity: AppCompatActivity) { |
|
|
|
|
|
|
|
startTime = System.currentTimeMillis() |
|
|
|
source = ActivitySource(activity) |
|
|
|
source = ActivitySource(activity) |
|
|
|
permissions = ArrayList() |
|
|
|
permissions = ArrayList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
constructor(fragment: Fragment) { |
|
|
|
constructor(fragment: Fragment) { |
|
|
|
|
|
|
|
startTime = System.currentTimeMillis() |
|
|
|
source = FragmentSource(fragment) |
|
|
|
source = FragmentSource(fragment) |
|
|
|
permissions = ArrayList() |
|
|
|
permissions = ArrayList() |
|
|
|
} |
|
|
|
} |
|
|
@ -101,8 +95,6 @@ internal class Request : OnRequestPermissionsResultCallback { |
|
|
|
onPermissionsGranted(requestCode) |
|
|
|
onPermissionsGranted(requestCode) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
startTime = System.currentTimeMillis() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun clear() { |
|
|
|
fun clear() { |
|
|
|