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

ProviderUpdateRequester

open class ProviderUpdateRequester
kotlin.Any
   ↳ androidx.wear.complications.ProviderUpdateRequester

Allows complication providers to request update calls from the system. This effectively allows providers to push updates to the system outside of the update request cycle.

Summary

Public constructors
<init>(@NonNull context: Context, @NonNull providerComponent: ComponentName)

Public methods
open Unit
requestUpdate(@NonNull vararg complicationIds: Int)

Requests that the system call onComplicationUpdate on the specified provider, for the given complication ids.

open Unit

Requests that the system call onComplicationUpdate on the specified provider, for all active complications using that provider.

Public constructors

<init>

ProviderUpdateRequester(
    @NonNull context: Context,
    @NonNull providerComponent: ComponentName)
Parameters
context Context: The provider's context
providerComponent ComponentName: the component name of the ComplicationProviderService that this will request updates for

Public methods

requestUpdate

open fun requestUpdate(@NonNull vararg complicationIds: Int): Unit

Requests that the system call onComplicationUpdate on the specified provider, for the given complication ids. Inactive complications are ignored, as are complications configured to use a different provider.

Parameters
complicationIds Int: the ids of the complications to be updated, as provided in calls to ComplicationProviderService#onComplicationActivated and ComplicationProviderService#onComplicationUpdate.

requestUpdateAll

open fun requestUpdateAll(): Unit

Requests that the system call onComplicationUpdate on the specified provider, for all active complications using that provider.

This will do nothing if no active complications are configured to use the specified provider.

This will also only work if called from the same package as the provider.