RawInkSession

Exclusive, generation-aware owner of the firmware raw-ink overlay.

All lifecycle, input, surface, and commit commands are processed on one private queue. The public suspend functions may be called from any dispatcher.

Types

Link copied to clipboard
object Companion

Factory methods for exclusive raw-ink sessions.

Properties

Link copied to clipboard
open override val completedStrokes: Flow<InkStroke>

Lossless channel with an enforced single collector.

Link copied to clipboard
open override val events: Flow<PenEvent>

Lossless and ordered while collected; events are not retained without a collector.

Link copied to clipboard
open override val preview: StateFlow<InkPreview?>

Latest-wins preview. Sequence numbers make any coalesced intermediate updates explicit.

Link copied to clipboard
open override val state: StateFlow<RawInkSessionState>

Current lifecycle state of this session.

Functions

Link copied to clipboard
open override fun close()

Requests asynchronous session cleanup.

Link copied to clipboard
open suspend override fun closeAndAwait(): Result<Unit>

Closes the session and waits for all firmware cleanup to finish.

Link copied to clipboard
open suspend override fun commit(bitmap: Bitmap, destination: Rect, dirtyRegion: Rect = destination, options: CommitOptions = CommitOptions()): Result<CommitReceipt>

Posts a bitmap beneath the overlay and restores raw-ink rendering afterward.

Link copied to clipboard
open suspend override fun pause(): Result<Unit>

Pauses raw input and firmware overlay rendering.

Link copied to clipboard
open suspend override fun resume(): Result<Unit>

Resumes raw input and overlay rendering when the surface is available.