Skip to content

Instantly share code, notes, and snippets.

@hichamboushaba
Last active November 16, 2021 14:57
Show Gist options
  • Save hichamboushaba/28c511857c41ccbddbc516303255d732 to your computer and use it in GitHub Desktop.
Save hichamboushaba/28c511857c41ccbddbc516303255d732 to your computer and use it in GitHub Desktop.
class PermissionManager {
fun hasPermission(permission: String): Boolean
suspend fun requestPermission(permission: String): PermissionStatus
suspend fun requestPermissions(vararg permission: String): Map<String, PermissionStatus>
}
sealed class PermissionStatus
object PermissionGranted : PermissionStatus()
data class PermissionDenied(val shouldShowRationale: Boolean) : PermissionStatus()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment