DefaultProviderPolicy


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 -- such as when it isn't installed or it doesn't support the requested type -- then the next one is 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.

Introduced in Wear OS 4.

Syntax

<DefaultProviderPolicy defaultSystemProvider="string" defaultSystemProviderType="string" />

Attributes

A DefaultProviderPolicy has the following attributes:

Required attributes

The following attributes are required:

defaultSystemProvider

The defaultSystemProvider is a system complication data source that acts as a final fallback in case no primary or secondary providers are specified, or no non-system data sources can be used. The defaultSystemProvider attribute should be set to a string constant value derived from the list of Wear SystemDataSources values, such as STEP_COUNT.

The full list of available values is:

defaultSystemProviderType
The type of the defaultSystemProvider to disambiguate where a system provider supports multiple types. Supported values are SHORT_TEXT, LONG_TEXT, MONOCHROMATIC_IMAGE, SMALL_IMAGE, PHOTO_IMAGE,RANGED_VALUE, and EMPTY.

Optional attributes

The following attributes are optional:

primaryProvider
The component name of the first data source to try.
primaryProviderType
The default Complication Type if a primaryProvider is selected. Supported values are SHORT_TEXT, LONG_TEXT, MONOCHROMATIC_IMAGE, SMALL_IMAGE, PHOTO_IMAGE, RANGED_VALUE, and EMPTY
secondaryProvider
The component name of the second data source to try.
secondaryProviderType
The default Complication Type if a secondaryProvider is selected. Supported values are SHORT_TEXT, LONG_TEXT, MONOCHROMATIC_IMAGE, SMALL_IMAGE, PHOTO_IMAGE, RANGED_VALUE, and EMPTY