aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-05-21 20:29:20 -0700
committerAllan Wang <me@allanwang.ca>2019-05-21 20:29:20 -0700
commitf8b58a39ab65a7097f731ab4cf38516d1c57f220 (patch)
tree74bb29050a3424d1aa7b6312555cb1c91798f37f
parentb787e49a5f8f97a2b330d4503ceb66056ef9ccd7 (diff)
downloadkau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.tar.gz
kau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.tar.bz2
kau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.zip
Use set for manifest permissions
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
index 769a9fb..4d97070 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt
@@ -41,12 +41,12 @@ internal object PermissionManager {
/**
* Retrieve permissions requested in our manifest
*/
- private val manifestPermission = lazyContext<Array<String>> {
+ private val manifestPermission = lazyContext<Set<String>> {
try {
- it.packageManager.getPackageInfo(it.packageName, PackageManager.GET_PERMISSIONS)?.requestedPermissions
- ?: emptyArray()
+ it.packageManager.getPackageInfo(it.packageName, PackageManager.GET_PERMISSIONS)?.requestedPermissions?.toSet()
+ ?: emptySet()
} catch (e: Exception) {
- emptyArray()
+ emptySet()
}
}