open class ProviderInfoRetriever : AutoCloseable
ComplicationProviderInfo for a watch face's complications.
To use construct an instance and call
retrieveProviderInfo which returns a .
Further calls to
retrieveProviderInfo may be made using the same instance of this class, but
close must be called when it is no longer needed. Once release has been called, further retrieval attempts will fail.
Releases the connection to the complication system used by this class.
ProviderInfoRetriever(@NonNull context: Context)
||Context: the current context|
open fun close(): Unit
Releases the connection to the complication system used by this class. This must be called when the retriever is no longer needed.
Any outstanding or subsequent futures returned by
retrieveProviderInfo will resolve with null. This class implements the Java
AutoClosable interface and may be used with try-with-resources.
@NonNull open fun retrieveProviderInfo(
@NonNull watchFaceComponent: ComponentName,
@NonNull watchFaceComplicationIds: IntArray
ComplicationProviderInfo for the specified complication ids on the specified watch face. When the info is received, the listener will receive a callback for each id. These callbacks will occur on the main thread.
This will only work if the package of the current app is the same as the package of the specified watch face.
||ComponentName: the ComponentName of the WatchFaceService for which info is being requested|
||IntArray: ids of the complications that info is being requested for|