# ComplicationDataSourceInfo

Artifact: [androidx.wear.watchface:watchface-complications](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever.kt+class:androidx.wear.watchface.complications.ComplicationDataSourceInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

*** ** * ** ***


```
public final class ComplicationDataSourceInfo
```

<br />

*** ** * ** ***

Holder of details of a complication data source, for use by watch faces (for example, to show the current complication data source in settings). A `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever` can be used to obtain references of this class for each of a watch face's complications.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#ComplicationDataSourceInfo(kotlin.String,kotlin.String,android.graphics.drawable.Icon,androidx.wear.watchface.complications.data.ComplicationType,android.content.ComponentName)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html appName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/drawable/Icon.html icon, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType type, https://developer.android.com/reference/android/content/ComponentName.html componentName )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getAppName()()` The name of the application containing the complication data source. |
| `final https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getComponentName()()` The complication data source's {@link ComponentName}. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getFallbackPreviewData()()` Lazily constructed fallback preview `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` based on this ComplicationDataSourceInfo. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/drawable/Icon.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getIcon()()` The icon for the complication data source. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getName()()` The name of the complication data source. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#getType()()` The type of the complication provided by the data source. |
| `int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfo#toString()()` |

## Public constructors

### ComplicationDataSourceInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public ComplicationDataSourceInfo(
    @NonNull String appName,
    @NonNull String name,
    @NonNull Icon icon,
    @NonNull ComplicationType type,
    ComponentName componentName
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAppName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final @NonNull String getAppName()
```

The name of the application containing the complication data source.

### getComponentName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final ComponentName getComponentName()
```

The complication data source's {@link ComponentName}.

This field is populated only on Android R and above and it is `null` otherwise.

### getFallbackPreviewData

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final @NonNull ComplicationData getFallbackPreviewData()
```

Lazily constructed fallback preview `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` based on this ComplicationDataSourceInfo. This is useful when `https://developer.android.com/reference/androidx/wear/watchface/complications/ComplicationDataSourceInfoRetriever#retrievePreviewComplicationData(android.content.ComponentName,androidx.wear.watchface.complications.data.ComplicationType)` returns `null` (e.g. on a pre-android R device).

### getIcon

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final @NonNull Icon getIcon()
```

The icon for the complication data source.

### getName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final @NonNull String getName()
```

The name of the complication data source.

### getType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

```
public final @NonNull ComplicationType getType()
```

The type of the complication provided by the data source.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```