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
element must contain the following attributes:
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. ThedefaultSystemProvider
attribute should be set to a string constant value from the list of WearSystemProvider
values, such asSTEP_COUNT
. defaultSystemProviderType
- The type of the
defaultSystemProvider
to disambiguate where a system provider supports multiple types. Supported values areSHORT_TEXT
,LONG_TEXT
,MONOCHROMATIC_IMAGE
,SMALL_IMAGE
,PHOTO_IMAGE
,RANGED_VALUE
, andEMPTY
.
A DefaultProviderPolicy
can optionally support the following attributes:
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
, andEMPTY
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
, andEMPTY
Recommended for you
- Note: link text is displayed when JavaScript is off
- ComplicationSlot
- Complication
- Add complications to a watch face