Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext.versions = [
minSdk: 16,
compileSdk: 33,
buildTools: "29.0.3",
publishVersion: "0.9.54",
publishVersion: "0.9.55",
publishVersionCode: 1
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ open class SecureActivityImpl(private val activity: FragmentActivity): SecureFra
//set the callback if permissions are not already granted
mOnResultCallback = onResult

//check permission that aren't granted which are needed
val needed = permissions.associateBy {
ActivityCompat.checkSelfPermission(activity, it) == PackageManager.PERMISSION_GRANTED
}.filter { !it.key }
.map { it.value }
//check permissions that aren't granted which are needed
val needed = permissions.filter {
ActivityCompat.checkSelfPermission(activity, it) != PackageManager.PERMISSION_GRANTED
}

if (needed.isNotEmpty()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ open class SecureFragmentImpl(private val fragment: Fragment): SecureFragmentInt

fragment.context?.let { ctx ->

//check permission that aren't granted which are needed
val needed = permissions.associateBy {
ActivityCompat.checkSelfPermission(ctx, it) == PackageManager.PERMISSION_GRANTED
}.filter { !it.key }
.map { it.value }
//check permissions that aren't granted which are needed
val needed = permissions.filter {
ActivityCompat.checkSelfPermission(ctx, it) != PackageManager.PERMISSION_GRANTED
}

if (needed.isNotEmpty()) {

Expand Down
Loading