PromptsCoordinator

Arbitrates the shared New Tab Page prompt surface between the Modal Coordinator and the Remote Messaging Framework (RMF) inline card, enforcing:

  1. No overlap: the surface is claimed (tryClaim) until the prompt is shown (onClaimDone) or turns out not to materialize (onClaimCancelled).

  2. Quiet gaps between prompts, sized by the type about to show.

  3. Fair access: a claimant finding the surface busy waits briefly rather than giving up.

All gating sits behind the promptsCoordinator kill-switch: when disabled, tryClaim always returns true and the reports are no-ops (see isEnabled).

Functions

Link copied to clipboard
abstract suspend fun isEnabled(): Boolean
Link copied to clipboard
abstract suspend fun onClaimCancelled(type: PromptType)

Reports that the claim never became a prompt: frees the surface without stamping the gap. Ignored unless type holds the claim.

Link copied to clipboard
abstract suspend fun onClaimDone(type: PromptType)

Reports that the claimed prompt reached the user: stamps the gap and frees the surface. Reported once showing is certain rather than on dismissal, so a prompt that never reports leaving the screen cannot strand the claim. Ignored unless type holds the claim.

Link copied to clipboard
abstract suspend fun tryClaim(type: PromptType): Boolean

Claims the shared prompt surface for type.