ComplicationDataSourceUpdateRequester


interface ComplicationDataSourceUpdateRequester


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

Summary

Public companion functions

ComplicationDataSourceUpdateRequester
create(context: Context, complicationDataSourceComponent: ComponentName)

Creates a ComplicationDataSourceUpdateRequester.

Public functions

Unit
requestUpdate(vararg complicationInstanceIds: Int)

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

Unit

Requests that the system call onComplicationUpdate on the specified complication data source, for all active complications using that complication data source.

Public companion functions

create

Added in 1.0.0
fun create(context: Context, complicationDataSourceComponent: ComponentName): ComplicationDataSourceUpdateRequester

Creates a ComplicationDataSourceUpdateRequester.

Parameters
context: Context

The ComplicationDataSourceService's Context

complicationDataSourceComponent: ComponentName

The ComponentName of the ComplicationDataSourceService to reload.

Public functions

requestUpdate

Added in 1.0.0
fun requestUpdate(vararg complicationInstanceIds: Int): Unit

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

Parameters
vararg complicationInstanceIds: Int

The system's IDs for the complications to be updated as provided to ComplicationDataSourceService.onComplicationActivated and ComplicationDataSourceService.onComplicationRequest.

requestUpdateAll

Added in 1.0.0
fun requestUpdateAll(): Unit

Requests that the system call onComplicationUpdate on the specified complication data source, for all active complications using that complication data source.

This will do nothing if no active complications are configured to use the specified complication data source.

This will also only work if called from the same package as the omplication data source.