diff options
author | Allan Wang <me@allanwang.ca> | 2019-05-21 20:29:20 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-05-21 20:29:20 -0700 |
commit | f8b58a39ab65a7097f731ab4cf38516d1c57f220 (patch) | |
tree | 74bb29050a3424d1aa7b6312555cb1c91798f37f /core/src | |
parent | b787e49a5f8f97a2b330d4503ceb66056ef9ccd7 (diff) | |
download | kau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.tar.gz kau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.tar.bz2 kau-f8b58a39ab65a7097f731ab4cf38516d1c57f220.zip |
Use set for manifest permissions
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt | 8 |
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() } } |