requestSuspend

suspend fun requestSuspend(rationaleMessage: String? = null, settingsMessage: String? = null): GrantStatus

A suspending alternative to request. Suspends the current coroutine until the grant flow completes (granted, denied, or dismissed).

When the flow needs a rationale or settings-guide dialog, it parks until the dialog host resumes it — so a host SHOULD be collecting state (e.g. GrantDialog) before requesting. With no host attached the flow does not park: the dialog state is cleared and the call completes immediately with the denied status (2.3.0 — previously it suspended forever, silently wedging the caller). The callback-based request is unaffected.

Return

The final GrantStatus after the flow completes. Returns GrantStatus.BUSY if a request is already in progress.

Parameters

rationaleMessage

Custom message for rationale dialog (optional)

settingsMessage

Custom message for settings dialog (optional)