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 @Nullable DeviceConfig

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

final @Nullable UserStyleData

The initial UserStyle stored as a UserStyleData or null.

final @Nullable 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 @RequiresApi(value = "30") @NonNull 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(
    @NonNull ComponentName watchFaceComponentName,
    @NonNull String editorPackageName,
    @Nullable UserStyleData initialUserStyle
)

Constructs an EditorRequest without a WatchFaceId.

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

Public fields

editorPackageName

@NonNull
public final @NonNull String editorPackageName

The package name of the watch face editor APK.

headlessDeviceConfig

@Nullable
public final @Nullable 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.

initialUserStyle

@Nullable
public final @Nullable UserStyleData initialUserStyle

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

previewScreenshotParams

@Nullable
public final @Nullable 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

@NonNull
public final @NonNull ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

watchFaceId

@RequiresApi(value = "30")
@NonNull
public final @RequiresApi(value = "30") @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(
    @NonNull ComponentName watchFaceComponentName,
    @NonNull String editorPackageName,
    @Nullable UserStyleData initialUserStyle
)

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

Parameters
@NonNull ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

@NonNull String editorPackageName

The package name of the watch face editor APK.

@Nullable 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(
    @NonNull ComponentName watchFaceComponentName,
    @NonNull String editorPackageName,
    @Nullable UserStyleData initialUserStyle,
    @NonNull WatchFaceId watchFaceId,
    @Nullable DeviceConfig headlessDeviceConfig,
    @Nullable PreviewScreenshotParams previewScreenshotParams
)
Parameters
@NonNull ComponentName watchFaceComponentName

The ComponentName of the watch face being edited.

@NonNull String editorPackageName

The package name of the watch face editor APK.

@Nullable UserStyleData initialUserStyle

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

@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.

@Nullable 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.

@Nullable 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.