SimpleGrantManager

Deprecated

FOR TESTING AND DEMO ONLY. DO NOT USE IN PRODUCTION. Use GrantFactory.create() instead.

Simple mock implementation for demo purposes.

⚠️ FOR TESTING AND DEMO ONLY. DO NOT USE IN PRODUCTION. Use GrantFactory.create() for production usage.

This simulates realistic grant request behavior:

  • First request: User denies → DENIED (shows rationale)

  • Second request: User denies again → DENIED_ALWAYS (must go to settings)

  • Third request: User grants → GRANTED

This allows testing all three dialog flows:

  1. Rationale dialog (after first denial)

  2. Settings dialog (after second denial)

  3. Success callback (after grant)

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Simulation mode for testing different scenarios

Properties

Functions

Link copied to clipboard
open suspend override fun checkStatus(grant: GrantPermission): GrantStatus

Checks the current status of a permission WITHOUT showing any UI.

Link copied to clipboard
open override fun openSettings()

Opens the app's settings page where user can manually enable grants.

Link copied to clipboard
open suspend override fun request(grant: GrantPermission): GrantStatus

Requests a permission from the user.

open suspend override fun request(grants: List<GrantPermission>): Map<GrantPermission, GrantStatus>

Request multiple grants from the system at once.

Link copied to clipboard
fun reset()

Reset simulation state (useful for demo)

Link copied to clipboard
open override fun setLauncher(launcher: GrantLauncher)

Set the launcher for permission requests. This must be called from the host activity or fragment.