ComplicationDataSourceInfo


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

public final class ComplicationDataSourceInfo


Holder of details of a complication data source, for use by watch faces (for example, to show the current complication data source in settings). A ComplicationDataSourceInfoRetriever can be used to obtain references of this class for each of a watch face's complications.

Summary

Public constructors

ComplicationDataSourceInfo(
    @NonNull String appName,
    @NonNull String name,
    @NonNull Icon icon,
    @NonNull ComplicationType type,
    ComponentName componentName
)

Public methods

boolean
equals(Object other)
final @NonNull String

The name of the application containing the complication data source.

final ComponentName

The complication data source's {@link ComponentName}.

final @NonNull ComplicationData

Lazily constructed fallback preview ComplicationData based on this ComplicationDataSourceInfo.

final @NonNull Icon

The icon for the complication data source.

final @NonNull String

The name of the complication data source.

final @NonNull ComplicationType

The type of the complication provided by the data source.

int
@NonNull String

Public constructors

ComplicationDataSourceInfo

Added in 1.0.0
public ComplicationDataSourceInfo(
    @NonNull String appName,
    @NonNull String name,
    @NonNull Icon icon,
    @NonNull ComplicationType type,
    ComponentName componentName
)

Public methods

equals

public boolean equals(Object other)

getAppName

Added in 1.0.0
public final @NonNull String getAppName()

The name of the application containing the complication data source.

getComponentName

Added in 1.0.0
public final ComponentName getComponentName()

The complication data source's {@link ComponentName}.

This field is populated only on Android R and above and it is null otherwise.

getFallbackPreviewData

Added in 1.0.0
public final @NonNull ComplicationData getFallbackPreviewData()

Lazily constructed fallback preview ComplicationData based on this ComplicationDataSourceInfo. This is useful when ComplicationDataSourceInfoRetriever.retrievePreviewComplicationData returns null (e.g. on a pre-android R device).

getIcon

Added in 1.0.0
public final @NonNull Icon getIcon()

The icon for the complication data source.

getName

Added in 1.0.0
public final @NonNull String getName()

The name of the complication data source.

getType

Added in 1.0.0
public final @NonNull ComplicationType getType()

The type of the complication provided by the data source.

hashCode

public int hashCode()

toString

public @NonNull String toString()