From f8b58a39ab65a7097f731ab4cf38516d1c57f220 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 21 May 2019 20:29:20 -0700 Subject: Use set for manifest permissions --- .../main/kotlin/ca/allanwang/kau/permissions/PermissionManager.kt | 8 ++++---- 1 file 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> { + private val manifestPermission = lazyContext> { 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() } } -- cgit v1.2.3