ComplicationDataSourceUpdateRequester

public 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 methods

default static final @NonNull ComplicationDataSourceUpdateRequester
create(
    @NonNull Context context,
    @NonNull ComponentName complicationDataSourceComponent
)

Creates a ComplicationDataSourceUpdateRequester.

abstract void
requestUpdate(int complicationInstanceIds)

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

abstract void

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

Public methods

create

Added in 1.0.0
default static final @NonNull ComplicationDataSourceUpdateRequester create(
    @NonNull Context context,
    @NonNull ComponentName complicationDataSourceComponent
)

Creates a ComplicationDataSourceUpdateRequester.

Parameters
@NonNull Context context

The ComplicationDataSourceService's Context

@NonNull ComponentName complicationDataSourceComponent

The ComponentName of the ComplicationDataSourceService to reload.

requestUpdate

Added in 1.0.0
abstract void requestUpdate(int complicationInstanceIds)

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
int complicationInstanceIds

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

requestUpdateAll

Added in 1.0.0
abstract void requestUpdateAll()

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.