DefaultComplicationDataSourcePolicy

public final class DefaultComplicationDataSourcePolicy


A watch face may wish to try and set one or more non-system data sources as the default data source for a complication. If a complication data source can't be used for some reason (e.g. it isn't installed or it doesn't support the requested type, or the watch face lacks the necessary permission) then the next one will be tried. A system complication data source acts as a final fallback in case no non-system data sources can be used.

If the DefaultComplicationDataSourcePolicy is empty then no default is set.

Summary

Public fields

final ComponentName

First of two non-system data sources to be tried in turn.

final ComplicationType

The default ComplicationType for primaryDataSource.

final ComponentName

Second of two non-system data sources to be tried in turn.

final ComplicationType

The default ComplicationType for secondaryDataSource.

final int

Fallback in case none of the non-system data sources could be used.

final @NonNull ComplicationType

The default ComplicationType for systemDataSourceFallback.

Public constructors

No default complication data source.

Uses systemProvider as the default complication data source.

DefaultComplicationDataSourcePolicy(
    @SystemDataSources.DataSourceId int systemDataSource,
    ComplicationType systemDataSourceDefaultType
)

Uses a system data source as the default complication data source.

DefaultComplicationDataSourcePolicy(
    ComponentName dataSource,
    @SystemDataSources.DataSourceId int systemDataSourceFallback
)

Attempts to use dataSource as the default complication complication data source, if not present then systemDataSourceFallback will be used instead.

DefaultComplicationDataSourcePolicy(
    ComponentName primaryDataSource,
    ComponentName secondaryDataSource,
    @