# ProviderInfoRetriever

Summary:[Nested Classes](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever#nestedclasses)\|[Ctors](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever#pubctors)\|[Methods](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever#inhmethods)  

# ProviderInfoRetriever

`
public


class
ProviderInfoRetriever
`  
`

extends `[Object](http://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|--------------------------------------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.wearable.complications.ProviderInfoRetriever |

<br />

*** ** * ** ***

<br />

**This class is deprecated.**   
use the[Jetpack Wear Watch Face](https://developer.android.com/jetpack/androidx/releases/wear-watchface)libraries instead.

Retrieves[ComplicationProviderInfo](https://developer.android.com/reference/android/support/wearable/complications/ComplicationProviderInfo.html)for a watch face's complications.

To use, construct an instance providing an[Executor](http://developer.android.com/reference/java/util/concurrent/Executor.html)(that should be for a background thread), and then call[init()](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#init()). Then[retrieveProviderInfo(ProviderInfoRetriever.OnProviderInfoReceivedCallback, ComponentName, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#retrieveProviderInfo(android.support.wearable.complications.ProviderInfoRetriever.OnProviderInfoReceivedCallback,%20android.content.ComponentName,%20int...))may be called. The retrieval will be performed using the provided executor, and the provided[ProviderInfoRetriever.OnProviderInfoReceivedCallback](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.OnProviderInfoReceivedCallback.html)will be called when complete.

Further calls to[retrieveProviderInfo(ProviderInfoRetriever.OnProviderInfoReceivedCallback, ComponentName, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#retrieveProviderInfo(android.support.wearable.complications.ProviderInfoRetriever.OnProviderInfoReceivedCallback,%20android.content.ComponentName,%20int...))may be made using the same instance of this class, but[release()](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#release())must be called when it is no longer needed. Once release has been called, further retrieval attempts will fail.

## Summary

|                                                                                                                                                                        ### Nested classes                                                                                                                                                                         ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ProviderInfoRetriever.OnProviderInfoReceivedCallback](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.OnProviderInfoReceivedCallback.html) *This class is deprecated. use the[Jetpack Wear Watch Face](https://developer.android.com/jetpack/androidx/releases/wear-watchface)libraries instead.* |

|                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ProviderInfoRetriever](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#ProviderInfoRetriever(android.content.Context,%20java.util.concurrent.Executor))`(`[Context](http://developer.android.com/reference/android/content/Context.html)` context, `[Executor](http://developer.android.com/reference/java/util/concurrent/Executor.html)` executor) ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[init](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#init())`() ` Initiates the connection between this class and the complications system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` void` | ` `[release](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#release())`() ` Releases the connection to the complication system used by this class.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void` | ` `[retrieveProviderInfo](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#retrieveProviderInfo(android.support.wearable.complications.ProviderInfoRetriever.OnProviderInfoReceivedCallback,%20android.content.ComponentName,%20int...))`(`[ProviderInfoRetriever.OnProviderInfoReceivedCallback](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.OnProviderInfoReceivedCallback.html)` callback, `[ComponentName](http://developer.android.com/reference/android/content/ComponentName.html)` watchFaceComponent, int... watchFaceComplicationIds) ` Requests[ComplicationProviderInfo](https://developer.android.com/reference/android/support/wearable/complications/ComplicationProviderInfo.html)for the specified complication ids on the specified watch face. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Public constructors

### ProviderInfoRetriever

```
public ProviderInfoRetriever (Context context, 
                Executor executor)
```

<br />

<br />

|                                                        Parameters                                                         ||
|------------|---------------------------------------------------------------------------------------------------------------|
| `context`  | `Context`: the current context <br />                                                                         |
| `executor` | `Executor`: used to retrieve the provider info. This executor should run tasks on a background thread. <br /> |

## Public methods

### init

```
public void init ()
```

Initiates the connection between this class and the complications system. This must be called before[retrieveProviderInfo(ProviderInfoRetriever.OnProviderInfoReceivedCallback, ComponentName, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#retrieveProviderInfo(android.support.wearable.complications.ProviderInfoRetriever.OnProviderInfoReceivedCallback,%20android.content.ComponentName,%20int...))will work.

<br />

### release

```
public void release ()
```

Releases the connection to the complication system used by this class. This must be called when the retriever is no longer needed.

Any outstanding retrievals will fail, resulting in calls to[onRetrievalFailed](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.OnProviderInfoReceivedCallback.html#onRetrievalFailed()). Any subsequent calls to[retrieveProviderInfo(ProviderInfoRetriever.OnProviderInfoReceivedCallback, ComponentName, int...)](https://developer.android.com/reference/android/support/wearable/complications/ProviderInfoRetriever.html#retrieveProviderInfo(android.support.wearable.complications.ProviderInfoRetriever.OnProviderInfoReceivedCallback,%20android.content.ComponentName,%20int...))will also result in failure.

<br />

### retrieveProviderInfo

```
public void retrieveProviderInfo (ProviderInfoRetriever.OnProviderInfoReceivedCallback callback, 
                ComponentName watchFaceComponent, 
                int... watchFaceComplicationIds)
```

Requests[ComplicationProviderInfo](https://developer.android.com/reference/android/support/wearable/complications/ComplicationProviderInfo.html)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.

<br />

|                                                                                                            Parameters                                                                                                             ||
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callback`                 | `ProviderInfoRetriever.OnProviderInfoReceivedCallback`: that will be called with the requested provider info once it has been retrieved <br />                                                        |
| `watchFaceComponent`       | `ComponentName`: the ComponentName of the[WatchFaceService](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html)for which info is being requested <br /> |
| `watchFaceComplicationIds` | `int`: ids of the complications that info is being requested for <br />                                                                                                                               |