EditorRequest

public final class EditorRequest


The request sent by WatchFaceEditorContract.createIntent.

Summary

Public fields

final @NonNull String

The package name of the watch face editor APK.

final DeviceConfig

If non-null then this is the DeviceConfig to use when creating a headless instance to back the EditorSession.

final UserStyleData

The initial UserStyle stored as a UserStyleData or null.

final PreviewScreenshotParams

If non-null then EditorSession upon closing will render a screenshot with PreviewScreenshotParams using the existing interactive or headless instance which will be sent in EditorState to any registered clients.

final @NonNull ComponentName

The ComponentName of the watch face being edited.

final @NonNull WatchFaceId
@RequiresApi(value = 30)
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.

Public constructors

EditorRequest(
    ComponentName watchFaceComponentName,
    String editorPackageName,
    UserStyleData initialUserStyle
)

Constructs an EditorRequest without a WatchFaceId.

EditorRequest(
    ComponentName watchFaceComponentName,
    String editorPackageName,
    UserStyleData initialUserStyle,
    WatchFaceId watchFaceId,
    DeviceConfig headlessDeviceConfig,
    PreviewScreenshotParams previewScreenshotParams
)

Public fields

editorPackageName

public final @NonNull String editorPackageName

The package name of the watch face editor APK.

headlessDeviceConfig

public final DeviceConfig headlessDeviceConfig

If non-null then this is the DeviceConfig to use when creating a headless instance to back the EditorSession. If null then the current interactive instance will be used. If there isn't one then the EditorSession won't launch until it's been created. Note supportsWatchFaceHeadlessEditing can be used to determine if this feature is supported. If it's not supported this parameter will be ignored.

initialUserStyle

public final UserStyleData initialUserStyle

The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession.

previewScreenshotParams

public final PreviewScreenshotParams previewScreenshotParams

If non-null then EditorSession upon closing will render a screenshot with PreviewScreenshotParams using the existing interactive or headless instance which will be sent in EditorState to any registered clients.

watchFaceComponentName

public final @NonNull ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

watchFaceId

@RequiresApi(value = 30)
public final @NonNull 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 ComponentName can have multiple instances.

Public constructors

EditorRequest

public final EditorRequest(
    ComponentName watchFaceComponentName,
    String editorPackageName,
    UserStyleData initialUserStyle
)

Constructs an EditorRequest without a WatchFaceId. This is for use pre-android R.

Parameters
ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

String editorPackageName

The package name of the watch face editor APK.

UserStyleData initialUserStyle

The initial UserStyle stored as a UserStyleData or null. Only required for a headless EditorSession. EditorSession.

EditorRequest

@RequiresApi(value = 30)
public final EditorRequest(
    ComponentName watchFaceComponentName,
    String editorPackageName,
    UserStyleData initialUserStyle,
    WatchFaceId watchFaceId,
    DeviceConfig headlessDeviceConfig,
    PreviewScreenshotParams previewScreenshotParams
)
Parameters
ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

String editorPackageName

The package name of the watch face editor APK.