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:
defaultSystemProviderThe
defaultSystemProvideris 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. ThedefaultSystemProviderattribute should be set to a string constant value derived from the list of WearSystemDataSourcesvalues, such asSTEP_COUNT.The full list of available values is:
APP_SHORTCUTDATEDAY_OF_WEEKFAVORITE_CONTACTHEART_RATENEXT_EVENTSTEP_COUNTSUNRISE_SUNSETTIME_AND_DATEUNREAD_NOTIFICATION_COUNTWATCH_BATTERYWORLD_CLOCKDAY_AND_DATEEMPTY
defaultSystemProviderType- The type of the
defaultSystemProviderto disambiguate where a system provider supports multiple types. Supported values areSHORT_TEXT,LONG_TEXT,MONOCHROMATIC_IMAGE,SMALL_IMAGE,PHOTO_IMAGE,RANGED_VALUE, andEMPTY.
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, 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
- Exposing data to watch face complications on Wear OS