Skip to main content

Module host

Module host 

Source
Expand description

Framework-owned application-host state and controls.

Structs§

DurableSaveRegistration
Keeps a shared durable save registered until its owner is dropped.
LifecycleEvent
A lifecycle transition delivered by the platform host.
LifecycleObserver
RAII lifecycle observer registration.
PlatformDirectories
Platform directory roots for application-owned files.

Enums§

DurableSaveError
An error reported by a durable-save callback.
DurableSaveOutcome
Result of a lifecycle or explicit save boundary.
LifecycleState
Android-style lifecycle state exposed to composition observers.
PlatformDirectoryError

Constants§

DEFAULT_DURABLE_SAVE_DEADLINE
The budget used when a host does not state one of its own.

Traits§

HostController
Host operations supplied by the framework platform backend.

Functions§

DurableSaveEffect
Registers fallible durable work for this composition’s lifetime.
ProvideLifecycle
Provides the host’s lifecycle state to descendant composables.
advance_lifecycle
Moves the host lifecycle to target through every state in between, in Android’s order: a stopped app starts before it resumes, and a resumed one pauses before it stops, so leaving the foreground always runs the durable saves. Paused and started count as the same place, as do created and stopped. Hosts whose platform reports only visibility and focus use this instead of dispatching each transition themselves.
application_directories
Returns typed directories for the registered application.
application_id
The registered application id, if a host has published one.
background_app
Requests that the host move the app to the background.
clear_application_id
Removes the registered application id (tests and teardown).
clear_host_controller
Removes the installed host controller.
current_lifecycle_state
Returns the latest lifecycle state published by the platform host.
dispatch_lifecycle
Publishes a lifecycle transition from the platform host.
dispatch_lifecycle_state
Publishes a platform lifecycle state and derives the transition source from the framework’s previous state.
durable_save_deadline
How long the installed host will wait for durable saves.
exit_app
Requests that the host finish the app.
host_controller
Returns the installed framework host controller.
local_lifecycle_state
The CompositionLocal carrying the host’s current lifecycle state.
observe_lifecycle
Observes host lifecycle transitions until the returned handle is dropped.
register_durable_save
Registers fallible work for the next save boundary. Callbacks run serially; timed-out runs are allowed to finish before another run can start.
register_preference_save
Registers a value to be sampled when saving starts and batched with other keys using the same store. The callback must not perform storage I/O.
rememberLifecycleEvents
Host lifecycle transitions as a composition-scoped stream.
rememberLifecycleState
The host’s lifecycle state as observable state.
run_durable_saves
Captures composition-local values on the calling thread and saves registered values in one serial batch. Call this on each composition’s owning thread.
set_application_id
Registers the id every framework-owned storage path is scoped by.
set_host_controller
Installs the framework host controller.
set_keep_screen_on
Enables or disables the host’s keep-screen-on flag.
window_lifecycle_state
The lifecycle state of a window or browser page that is visible and has keyboard focused, mapped the way Compose Multiplatform maps desktop windows: resumed while focused, paused while only visible, and stopped while minimized, hidden or in a background tab.

Type Aliases§

HostControllerRef