# EditorRequest

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/WatchFaceEditorContract.kt+class:androidx.wear.watchface.editor.EditorRequest) 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)

*** ** * ** ***

<br />

```
public final class EditorRequest
```

<br />

*** ** * ** ***

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

The request sent by `https://developer.android.com/reference/androidx/wear/watchface/editor/WatchFaceEditorContract#createIntent(android.content.Context,androidx.wear.watchface.editor.EditorRequest)`.

use Watch Face Format instead

## Summary

| ### Public constructors |
|---|
| `[EditorRequest](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#EditorRequest(android.content.ComponentName,kotlin.String,androidx.wear.watchface.style.UserStyleData))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceComponentName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html editorPackageName, https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData initialUserStyle )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 30) [EditorRequest](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#EditorRequest(android.content.ComponentName,kotlin.String,androidx.wear.watchface.style.UserStyleData,androidx.wear.watchface.client.WatchFaceId,androidx.wear.watchface.client.DeviceConfig,androidx.wear.watchface.editor.PreviewScreenshotParams))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceComponentName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html editorPackageName, https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData initialUserStyle, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceId watchFaceId, https://developer.android.com/reference/androidx/wear/watchface/client/DeviceConfig headlessDeviceConfig, https://developer.android.com/reference/androidx/wear/watchface/editor/PreviewScreenshotParams previewScreenshotParams )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest` | `[createFromIntent](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#createFromIntent(android.content.Intent))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `[getEditorPackageName](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getEditorPackageName())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final https://developer.android.com/reference/androidx/wear/watchface/client/DeviceConfig` | `[getHeadlessDeviceConfig](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getHeadlessDeviceConfig())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData` | `[getInitialUserStyle](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getInitialUserStyle())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final https://developer.android.com/reference/androidx/wear/watchface/editor/PreviewScreenshotParams` | `[getPreviewScreenshotParams](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getPreviewScreenshotParams())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html` | `[getWatchFaceComponentName](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getWatchFaceComponentName())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceId` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 30) [getWatchFaceId](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getWatchFaceId())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

## Public constructors

### EditorRequest

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)

```
public [EditorRequest](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#EditorRequest(android.content.ComponentName,kotlin.String,androidx.wear.watchface.style.UserStyleData))(
    @NonNull ComponentName watchFaceComponentName,
    @NonNull String editorPackageName,
    UserStyleData initialUserStyle
)
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/editor/EditorRequest` without a `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceId`. This is for use pre-android R.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceComponentName` | The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face being edited. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html editorPackageName` | The package name of the watch face editor APK. |
| `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData initialUserStyle` | The initial `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` stored as a `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData` or `null`. Only required for a headless `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`. `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`. |

### EditorRequest

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 = 30)
public [EditorRequest](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#EditorRequest(android.content.ComponentName,kotlin.String,androidx.wear.watchface.style.UserStyleData,androidx.wear.watchface.client.WatchFaceId,androidx.wear.watchface.client.DeviceConfig,androidx.wear.watchface.editor.PreviewScreenshotParams))(
    @NonNull ComponentName watchFaceComponentName,
    @NonNull String editorPackageName,
    UserStyleData initialUserStyle,
    @NonNull WatchFaceId watchFaceId,
    DeviceConfig headlessDeviceConfig,
    PreviewScreenshotParams previewScreenshotParams
)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html watchFaceComponentName` | The `https://developer.android.com/reference/android/content/ComponentName.html` of the watch face being edited. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html editorPackageName` | The package name of the watch face editor APK. |
| `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData initialUserStyle` | The initial `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` stored as a `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData` or `null`. Only required for a headless `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceId watchFaceId` | Unique ID for the instance of the watch face being edited, only defined for Android R and beyond, it's `null` on Android P and earlier. Note each distinct `https://developer.android.com/reference/android/content/ComponentName.html` can have multiple instances. |
| `https://developer.android.com/reference/androidx/wear/watchface/client/DeviceConfig headlessDeviceConfig` | If `non-null` then this is the `https://developer.android.com/reference/androidx/wear/watchface/client/DeviceConfig` to use when creating a headless instance to back the `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`. If `null` then the current interactive instance will be used. If there isn't one then the `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession` won't launch until it's been created. Note `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest.Companion#supportsWatchFaceHeadlessEditing(android.content.pm.PackageManager,kotlin.String)` can be used to determine if this feature is supported. If it's not supported this parameter will be ignored. |
| `https://developer.android.com/reference/androidx/wear/watchface/editor/PreviewScreenshotParams previewScreenshotParams` | If `non-null` then `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession` upon closing will render a screenshot with `https://developer.android.com/reference/androidx/wear/watchface/editor/PreviewScreenshotParams` using the existing interactive or headless instance which will be sent in `https://developer.android.com/reference/androidx/wear/watchface/client/EditorState` to any registered clients. |

## Public methods

### createFromIntent

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)

```
public static final @NonNull EditorRequest [createFromIntent](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#createFromIntent(android.content.Intent))(@NonNull Intent intent)
```

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

Returns an `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest` saved to a `https://developer.android.com/reference/android/content/Intent.html` by `https://developer.android.com/reference/androidx/wear/watchface/editor/WatchFaceEditorContract#createIntent(android.content.Context,androidx.wear.watchface.editor.EditorRequest)` if there is one or `null` otherwise. Intended for use by the watch face editor activity.

| Throws |
|---|---|
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-timeout-cancellation-exception/index.html` | in case of en error. |

### getEditorPackageName

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)

```
public final @NonNull String [getEditorPackageName](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getEditorPackageName())()
```

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

The package name of the watch face editor APK.

### getHeadlessDeviceConfig

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)

```
public final DeviceConfig [getHeadlessDeviceConfig](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getHeadlessDeviceConfig())()
```

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

If `non-null` then this is the `https://developer.android.com/reference/androidx/wear/watchface/client/DeviceConfig` to use when creating a headless instance to back the `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`. If `null` then the current interactive instance will be used. If there isn't one then the `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession` won't launch until it's been created. Note `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest.Companion#supportsWatchFaceHeadlessEditing(android.content.pm.PackageManager,kotlin.String)` can be used to determine if this feature is supported. If it's not supported this parameter will be ignored.

### getInitialUserStyle

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)

```
public final UserStyleData [getInitialUserStyle](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getInitialUserStyle())()
```

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

The initial `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` stored as a `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleData` or `null`. Only required for a headless `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession`.

### getPreviewScreenshotParams

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)

```
public final PreviewScreenshotParams [getPreviewScreenshotParams](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getPreviewScreenshotParams())()
```

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

If `non-null` then `https://developer.android.com/reference/androidx/wear/watchface/editor/EditorSession` upon closing will render a screenshot with `https://developer.android.com/reference/androidx/wear/watchface/editor/PreviewScreenshotParams` using the existing interactive or headless instance which will be sent in `https://developer.android.com/reference/androidx/wear/watchface/client/EditorState` to any registered clients.

### getWatchFaceComponentName

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)

```
public final @NonNull ComponentName [getWatchFaceComponentName](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getWatchFaceComponentName())()
```

> [!CAUTION]
> **This method 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.

### getWatchFaceId

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 = 30)
public final @NonNull WatchFaceId [getWatchFaceId](https://developer.android.com/reference/androidx/wear/watchface/editor/EditorRequest#getWatchFaceId())()
```

> [!CAUTION]
> **This method 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, only defined for Android R and beyond, it's `null` on Android P and earlier. Note each distinct `https://developer.android.com/reference/android/content/ComponentName.html` can have multiple instances.