Skip to content

Commit

Permalink
Catch manifest permission package exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Dec 2, 2024
1 parent 7d459ab commit 8946989
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ class GeolocationPermissionDelegate(private val session: Session) {
}

private fun manifestPermissions(): Array<String> {
val context = session.context
val packageInfo = context.packageManager.getPackageInfo(
context.packageName,
PackageManager.GET_PERMISSIONS
)
return try {
val context = session.context
val packageInfo = context.packageManager.getPackageInfo(
context.packageName,
PackageManager.GET_PERMISSIONS
)

return packageInfo.requestedPermissions
packageInfo.requestedPermissions
} catch (e: PackageManager.NameNotFoundException) {
logError("manifestPermissionsNotAvailable", e)
emptyArray()
}
}
}
}

0 comments on commit 8946989

Please sign in to comment.