ListenableWatchFaceMetadataClient


class ListenableWatchFaceMetadataClient


ListenableFuture-based compatibility wrapper around WatchFaceMetadataClient.create.

Summary

Public companion functions

ListenableFuture<WatchFaceMetadataClient>
create(context: Context, watchFaceName: ComponentName)

Constructs a WatchFaceMetadataClient for fetching metadata for the specified watch face.

ListenableFuture<WatchFaceMetadataClient>
createForRuntime(
    context: Context,
    watchFaceName: ComponentName,
    resourceOnlyWatchFacePackageName: String
)

Constructs a WatchFaceMetadataClient for fetching metadata for the specified resource only watch face runtime.

Public companion functions

create

Added in 1.1.0
fun create(context: Context, watchFaceName: ComponentName): ListenableFuture<WatchFaceMetadataClient>

Constructs a WatchFaceMetadataClient for fetching metadata for the specified watch face.

Parameters
context: Context

Calling application's Context.

watchFaceName: ComponentName

The ComponentName of the watch face to fetch meta data from.

Returns
ListenableFuture<WatchFaceMetadataClient>

A ListenableFuture which resolves with WatchFaceMetadataClient if there is one, otherwise it throws a ServiceNotBoundException if the underlying watch face control service can not be bound or a ServiceStartFailureException if the watch face dies during startup.

createForRuntime

Added in 1.2.0
fun createForRuntime(
    context: Context,
    watchFaceName: ComponentName,
    resourceOnlyWatchFacePackageName: String
): ListenableFuture<WatchFaceMetadataClient>

Constructs a WatchFaceMetadataClient for fetching metadata for the specified resource only watch face runtime. A resource only watch face runtime, is a special kind of watch face that is the runtime for a watch face defined by another package that contains only resources and no executable code.

Parameters
context: Context

Calling application's Context.

watchFaceName: ComponentName

The ComponentName of the watch face to fetch meta data from.

resourceOnlyWatchFacePackageName: String

The package the runtime should load the resources from.

Returns
ListenableFuture<WatchFaceMetadataClient>

A ListenableFuture which resolves with WatchFaceMetadataClient if there is one, otherwise it throws a ServiceNotBoundException if the underlying watch face control service can not be bound or a ServiceStartFailureException if the watch face dies during startup.