interface EditorSession

Known direct subclasses

ListenableFuture-based compatibility wrapper around EditorSession's suspending methods.

Interface for manipulating watch face state during a watch face editing session. The editor should adjust userStyle and call openComplicationDataSourceChooser to configure the watch face and call close when done. This reports the updated EditorState to the EditorListeners registered via EditorServiceClient.addListener.

For EditorSessions backed by a headless instance (see createHeadlessEditorSession and EditorRequest.headlessDeviceConfig), style changes are not applied to the interactive instance and it's up to the system to apply them. For EditorSessions backed by an interactive instance style changes are applied immediately. Its possible the system might fail to persist the style changes (e.g. to data base write failure or a crash) and if this happens it's the responsibility of the system to revert the style change.


Public fields

abstract Integer

The ID of the background complication or null if there isn't one.

abstract boolean

Whether any changes should be committed when the session is closed (defaults to true).

abstract @NonNull StateFlow<@NonNull Map<@NonNull Integer, @NonNull ComplicationSlotState>>

A Flow of a Map of complication slot ids to ComplicationSlotState for each complication slot.

abstract @NonNull StateFlow<@NonNull Map<@NonNull IntegerComplicationDataSourceInfo>>

Returns a flow of maps of androidx.wear.watchface.ComplicationSlot ids to ComplicationDataSourceInfo that represent the information available about the data source for each complication.

abstract @NonNull StateFlow<@NonNull Map<@NonNull Integer, @NonNull ComplicationData>>

Returns a flow of maps of androidx.wear.watchface.ComplicationSlot ids to preview ComplicationData suitable for use in rendering a preview of the watch face.

abstract @NonNull Instant

The reference preview