PenSession

Injectable application-facing pen-session contract.

Inheritors

Properties

Link copied to clipboard
abstract val completedStrokes: Flow<InkStroke>

Completed strokes in input order.

Link copied to clipboard
abstract val events: Flow<PenEvent>

Ordered raw pen events emitted while the stream is collected.

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

Latest preview snapshot, or null before a stroke begins.

Link copied to clipboard
abstract val state: StateFlow<RawInkSessionState>

Current lifecycle state of the session.

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun closeAndAwait(): Result<Unit>

Closes the session and waits for firmware resources and its process lease to be released.

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

Posts bitmap, refreshes dirtyRegion, and restores the session configuration.

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

Suspends firmware input and overlay rendering for this session.

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

Resumes firmware input and overlay rendering when a surface is available.