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.
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 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
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# DefaultProviderPolicy\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA watch face may wish to try and set one or more non-system data sources as the\ndefault data source for a complication. If a complication data source can't be\nused for some reason -- such as when it isn't installed or it doesn't support\nthe requested type -- then the next one is tried. A system complication data\nsource acts as a final fallback in case no non-system data sources can be used.\n\nIf the `DefaultComplicationDataSourcePolicy` is empty, then no default is set.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cDefaultProviderPolicy defaultSystemProvider=\"string\" defaultSystemProviderType=\"string\" /\u003e\n```\n\nAttributes\n----------\n\nA `DefaultProviderPolicy` has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`defaultSystemProvider`\n\n: The `defaultSystemProvider` is a system complication data source that\n acts as a final fallback in case no primary or secondary providers are\n specified, or no non-system data sources can be used. The\n `defaultSystemProvider` attribute should be set to a string constant value\n derived from the list of Wear [`SystemDataSources`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources) values, such as\n [`STEP_COUNT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_STEP_COUNT()).\n\n: The full list of available values is:\n\n- [`APP_SHORTCUT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_APP_SHORTCUT())\n- [`DATE`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_DATE())\n- [`DAY_OF_WEEK`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_DAY_OF_WEEK())\n- [`FAVORITE_CONTACT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_FAVORITE_CONTACT())\n- [`HEART_RATE`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_HEART_RATE())\n- [`NEXT_EVENT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_NEXT_EVENT())\n- [`STEP_COUNT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_STEP_COUNT())\n- [`SUNRISE_SUNSET`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_SUNRISE_SUNSET())\n- [`TIME_AND_DATE`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_TIME_AND_DATE())\n- [`UNREAD_NOTIFICATION_COUNT`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_UNREAD_NOTIFICATION_COUNT())\n- [`WATCH_BATTERY`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_WATCH_BATTERY())\n- [`WORLD_CLOCK`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_WORLD_CLOCK())\n- [`DAY_AND_DATE`](/reference/kotlin/androidx/wear/watchface/complications/SystemDataSources#DATA_SOURCE_DATE_AND_TIME())\n- `EMPTY`\n\n`defaultSystemProviderType`\n: The type of the `defaultSystemProvider` to disambiguate where a system\n provider supports multiple types. Supported values are `SHORT_TEXT`,\n `LONG_TEXT`, `MONOCHROMATIC_IMAGE`, `SMALL_IMAGE`, `PHOTO_IMAGE`,`RANGED_VALUE`,\n and `EMPTY`.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`primaryProvider`\n: The component name of the first data source to try.\n\n`primaryProviderType`\n: The default Complication Type if a primaryProvider is selected. Supported\n values are `SHORT_TEXT`, `LONG_TEXT`, `MONOCHROMATIC_IMAGE`, `SMALL_IMAGE`,\n `PHOTO_IMAGE`, `RANGED_VALUE`, and `EMPTY`\n\n`secondaryProvider`\n: The component name of the second data source to try.\n\n`secondaryProviderType`\n: The default Complication Type if a secondaryProvider is selected. Supported\n values are `SHORT_TEXT`, `LONG_TEXT`, `MONOCHROMATIC_IMAGE`, `SMALL_IMAGE`,\n `PHOTO_IMAGE`, `RANGED_VALUE`, and `EMPTY`\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [ComplicationSlot](/training/wearables/wff/complication/complication-slot)\n- [Complication](/training/wearables/wff/complication/complication)\n- [Exposing data to watch face complications on Wear OS](/codelabs/data-sources)"]]