# EditorSession

Artifact: [androidx.wear.watchface:watchface-editor](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/editor/EditorSession.kt+class:androidx.wear.watchface.editor.EditorSession) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession "View this page in Java")


```
interface EditorSession : AutoCloseable
```

<br />

Known direct subclasses [ListenableEditorSession](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/ListenableEditorSession)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/ListenableEditorSession` | **This class is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Interface for manipulating watch face state during a watch face editing session. The editor should adjust `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#userStyle()` and call `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#openComplicationDataSourceChooser(kotlin.Int)` to configure the watch face and call `https://developer.android.com/reference/java/lang/AutoCloseable.html#close()` when done. This reports the updated `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorState` to the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorListener`s registered via `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorServiceClient#addListener(androidx.wear.watchface.client.EditorListener,java.util.concurrent.Executor)`.

For EditorSessions backed by a headless instance (see `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#createHeadlessEditorSession(androidx.activity.ComponentActivity,android.content.Intent,androidx.wear.watchface.client.HeadlessWatchFaceClient)` and `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/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.

use Watch Face Format instead

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 27) @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [createHeadlessEditorSession](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#createHeadlessEditorSession(androidx.activity.ComponentActivity,android.content.Intent,androidx.wear.watchface.client.HeadlessWatchFaceClient))( activity: https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity, editIntent: https://developer.android.com/reference/android/content/Intent.html, headlessWatchFaceClient: https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/HeadlessWatchFaceClient )` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `suspend https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [createOnWatchEditorSession](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#createOnWatchEditorSession(androidx.activity.ComponentActivity))(activity: https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#DEFAULT_PREVIEW_INSTANT()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#EDITING_SESSION_TIMEOUT()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html?` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [getComplicationSlotIdAt](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#getComplicationSlotIdAt(kotlin.Int,kotlin.Int))(x: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, y: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `suspend https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/ChosenComplicationDataSource?` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [openComplicationDataSourceChooser](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#openComplicationDataSourceChooser(kotlin.Int))(complicationSlotId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [renderWatchFaceToBitmap](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map))( renderParameters: https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters, instant: https://developer.android.com/reference/java/time/Instant.html, slotIdToComplicationData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData>? )` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setOverrideComplications](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#setOverrideComplications(kotlin.collections.Map))( slotIdToComplicationData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData> )` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#backgroundComplicationSlotId()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#commitChangesOnClose()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/ComplicationSlotState>>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#complicationSlotsState()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/ComplicationDataSourceInfo?>>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#complicationsDataSourceInfo()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData>>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#complicationsPreviewData()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#previewReferenceInstant()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-mutable-state-flow/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#userStyle()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#userStyleSchema()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#watchFaceComponentName()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceId` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#watchFaceId()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Inherited functions |
|---|
| From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[close](https://developer.android.com/reference/java/lang/AutoCloseable.html#close())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. | |

## Public companion functions

### createHeadlessEditorSession

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
@RequiresApi(value = 27)
@UiThread
fun [createHeadlessEditorSession](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#createHeadlessEditorSession(androidx.activity.ComponentActivity,android.content.Intent,androidx.wear.watchface.client.HeadlessWatchFaceClient))(
    activity: ComponentActivity,
    editIntent: Intent,
    headlessWatchFaceClient: HeadlessWatchFaceClient
): EditorSession
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs an `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` for a remote watch face editor.

Caution the remote watchface must have been built with the same version of the watch face libraries.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` | The `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` associated with the EditorSession. |
| `editIntent: https://developer.android.com/reference/android/content/Intent.html` | The `https://developer.android.com/reference/android/content/Intent.html` sent by SysUI to launch the editing session. |
| `headlessWatchFaceClient: https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/HeadlessWatchFaceClient` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/HeadlessWatchFaceClient` to use for rendering etc... |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` or `null` if it could not be constructed. |

### createOnWatchEditorSession

```
@UiThread
suspend fun [createOnWatchEditorSession](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#createOnWatchEditorSession(androidx.activity.ComponentActivity))(activity: ComponentActivity): EditorSession
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs an `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` for an on watch face editor. This registers an activity result handler and so it must be called during an Activity or Fragment initialization path. The EditorSession is lifecycle aware and will automatically close when onDestroy is received.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` | The `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` associated with the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` | Deferred which is resolved with either the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession` or `null` if it can't be constructed. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-timeout-cancellation-exception/index.html` | if it takes longer than `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#EDITING_SESSION_TIMEOUT()` to create a watch face editor. |

## Public companion properties

### DEFAULT_PREVIEW_INSTANT

```
val DEFAULT_PREVIEW_INSTANT: Instant
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

If passed `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map)` this will signal that the watch face's default preview time should be used.

### EDITING_SESSION_TIMEOUT

```
val EDITING_SESSION_TIMEOUT: Duration
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Timeout allowed for waiting for creating the watch face editing session.

## Public functions

### getComplicationSlotIdAt

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
@UiThread
fun [getComplicationSlotIdAt](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#getComplicationSlotIdAt(kotlin.Int,kotlin.Int))(x: @Px Int, y: @Px Int): Int?
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the ID of the complication at the given coordinates or `null` if there isn't one. Only `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot`s with `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlotBoundsType#ROUND_RECT()` are supported by this function.

### openComplicationDataSourceChooser

```
@UiThread
suspend fun [openComplicationDataSourceChooser](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#openComplicationDataSourceChooser(kotlin.Int))(complicationSlotId: Int): ChosenComplicationDataSource?
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Opens the complication data source chooser and returns the chosen complication data source for the specified `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot`.

The result returns `null` if the operation was cancelled and otherwise returned an instance of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/ChosenComplicationDataSource` that contains information about the chosen data source.

| Parameters |
|---|---|
| `complicationSlotId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The id of the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` to select a complication data source for. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if a previous invocation of openComplicationDataSourceChooser is still running when openComplicationDataSourceChooser is called. |

### renderWatchFaceToBitmap

```
@UiThread
fun [renderWatchFaceToBitmap](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map))(
    renderParameters: RenderParameters,
    instant: Instant,
    slotIdToComplicationData: Map<Int, ComplicationData>?
): Bitmap
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Renders the watch face to a `https://developer.android.com/reference/android/graphics/Bitmap.html` using the current `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#userStyle()`.

| Parameters |
|---|---|
| `renderParameters: https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters` to render with. Must be `https://developer.android.com/reference/kotlin/androidx/wear/watchface/DrawMode#INTERACTIVE` |
| `instant: https://developer.android.com/reference/java/time/Instant.html` | The `https://developer.android.com/reference/java/time/Instant.html` to render with |
| `slotIdToComplicationData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData>?` | Override `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData` for each `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` to render with. Note using this feature is somewhat computationally expensive because under the hood it saves and restores the backing watch face instance's complications. If you need to render multiple times with the same slotIdToComplicationData, consider using `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map)` for a more efficient alternative. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | A `https://developer.android.com/reference/android/graphics/Bitmap.html` containing the screen shot with the specified parameters |

### setOverrideComplications

```
open fun [setOverrideComplications](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#setOverrideComplications(kotlin.collections.Map))(
    slotIdToComplicationData: Map<Int, ComplicationData>
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

For the duration of the editor session, applies an override to complications rendered via `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map)`. If you need to render multiple times with the same `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#setOverrideComplications(kotlin.collections.Map)` it's more efficient to use this API and call `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#renderWatchFaceToBitmap(androidx.wear.watchface.RenderParameters,java.time.Instant,kotlin.collections.Map)` with null slotIdToComplicationData. When the editor session ends this override will be removed.

Note if after this call updated complications are sent via `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/InteractiveWatchFaceClient#updateComplicationData(kotlin.collections.Map)`, they will only be applied once the editor session has ended.

| Parameters |
|---|---|
| `slotIdToComplicationData: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData>` | The complications you wish to set. Any slots not covered by this map will be unchanged. |

## Public properties

### backgroundComplicationSlotId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val backgroundComplicationSlotId: Int?
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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

### commitChangesOnClose

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
var commitChangesOnClose: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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

Note due to SysUI requirements `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorState` can't reliably be sent in the activity result because there are circumstances where `https://developer.android.com/reference/android/app/Activity.html#onStop()` doesn't get called but the UX requires us to commit changes.

Regardless of the value, on completion of the editor session, the original UserStyle is restored. Note we need SysUI's help to revert any complication data source changes. Caveat some complication data sources have their own config (e.g. the world clock has a timezone setting) and that config currently can't be reverted.

### complicationSlotsState

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val complicationSlotsState: StateFlow<Map<Int, ComplicationSlotState>>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of a Map of complication slot ids to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/ComplicationSlotState` for each complication slot.

If accessed from java, consider using androidx.lifecycle.FlowLiveDataConversions.asLiveData to observe changes.

### complicationsDataSourceInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val complicationsDataSourceInfo: StateFlow<Map<Int, ComplicationDataSourceInfo?>>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns a flow of maps of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` ids to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/ComplicationDataSourceInfo` that represent the information available about the data source for each complication. This data is fetched asynchronously and the map will initially be empty. For watch faces without complications this will always be empty.

Note new data may be pushed as result of running `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#openComplicationDataSourceChooser(kotlin.Int)`.

Note a `null` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/ComplicationDataSourceInfo` will be associated with a complication slot id if the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` is configured to show the empty complication data source.

### complicationsPreviewData

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val complicationsPreviewData: StateFlow<Map<Int, ComplicationData>>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns a flow of maps of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` ids to preview `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationData` suitable for use in rendering a preview of the watch face. This data is fetched asynchronously and the map will initially be empty. For watch faces without complications this will always be empty.

Note new data may be pushed as a result of running `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorSession#openComplicationDataSourceChooser(kotlin.Int)`.

Note if a slot is configured to be empty then the map will contain an instance of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/EmptyComplicationData` for that slot. Disabled complicationSlots are included in the map.

If accessed from java, consider using androidx.lifecycle.FlowLiveDataConversions.asLiveData to observe changes.

### previewReferenceInstant

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val previewReferenceInstant: Instant
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The reference preview `https://developer.android.com/reference/java/time/Instant.html` for this watch face to render previews with.

### userStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val userStyle: MutableStateFlow<UserStyle>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The current `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle`. Assigning to this will cause the style to update. However, styling changes to the watch face will be reverted upon exit.

If accessed from java, consider using androidx.lifecycle.FlowLiveDataConversions.asLiveData to observe changes.

### userStyleSchema

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val userStyleSchema: UserStyleSchema
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The watch face's `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema`.

### watchFaceComponentName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val watchFaceComponentName: ComponentName
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face being edited.

### watchFaceId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
val watchFaceId: WatchFaceId
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Unique ID for the instance of the watch face being edited. Note each distinct `https://developer.android.com/reference/android/content/ComponentName.html` can sometimes have multiple instances. See `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceId` for more details.