Google is committed to advancing racial equity for Black communities. See how.

DefaultComplicationProviderPolicy

class DefaultComplicationProviderPolicy
kotlin.Any
   ↳ androidx.wear.complications.DefaultComplicationProviderPolicy

A watch face may wish to try and set one or more non-system providers as the default provider for a complication. If a provider 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 provider acts as a final fallback in case no non-system providers can be used.

If the DefaultComplicationProviderPolicy is empty then no default is set.

Summary

Public constructors
<init>(providers: List<ComponentName>, systemProviderFallback: Int)

No default complication provider.

<init>(systemProvider: Int)

Uses systemProvider as the default complication provider.

<init>(provider: ComponentName, systemProviderFallback: Int)

Attempts to use provider as the default complication provider, if not present then systemProviderFallback will be used instead.

<init>(primaryProvider: ComponentName, secondaryProvider: ComponentName, systemProviderFallback: Int)

Attempts to use primaryProvider as the default complication provider, if not present then secondaryProvider will be tried and if that's not present then systemProviderFallback will be used instead.

Public methods
Boolean

Whether or not this DefaultComplicationProviderPolicy contains a default provider.

ArrayList<ComponentName>

Properties
ComponentName?

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

ComponentName?

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

Int

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

Public constructors

<init>

DefaultComplicationProviderPolicy(
    providers: List<ComponentName>,
    systemProviderFallback: Int)

<init>

DefaultComplicationProviderPolicy()

No default complication provider.

<init>

DefaultComplicationProviderPolicy(systemProvider: Int)

Uses systemProvider as the default complication provider.

<init>

DefaultComplicationProviderPolicy(
    provider: ComponentName,
    systemProviderFallback: Int)

Attempts to use provider as the default complication provider, if not present then systemProviderFallback will be used instead.

<init>

DefaultComplicationProviderPolicy(
    primaryProvider: ComponentName,
    secondaryProvider: ComponentName,
    systemProviderFallback: Int)

Attempts to use primaryProvider as the default complication provider, if not present then secondaryProvider will be tried and if that's not present then systemProviderFallback will be used instead.

Public methods

isEmpty

fun isEmpty(): Boolean

Whether or not this DefaultComplicationProviderPolicy contains a default provider.

providersAsList

fun providersAsList(): ArrayList<ComponentName>

Properties

primaryProvider

val primaryProvider: ComponentName?

First of two non-system providers to be tried in turn. Set to null if not required.

secondaryProvider

val secondaryProvider: ComponentName?

Second of two non-system providers to be tried in turn. Set to null if not required.

systemProviderFallback

val systemProviderFallback: Int

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