# MatchmakingRequest

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/matchmaking/MatchmakingRequest.kt+class:androidx.health.connect.client.matchmaking.MatchmakingRequest) Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

*** ** * ** ***


```
@ExperimentalMatchmakingApi
public final class MatchmakingRequest
```

<br />

*** ** * ** ***

Request class for matchmaking flow.

Use this class to launch a matchmaking flow to discover apps and devices that can write health data that the calling app has permission to read.

To check if matchmaking is available, call `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#FEATURE_MATCHMAKING()` as an argument.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#MatchmakingRequest(kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/Record>> recordTypes, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin> includedDataSources, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin> excludedDataSources )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#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/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin>` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#getExcludedDataSources()()` Set of `https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin` to exclude from the matchmaking results. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin>` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#getIncludedDataSources()()` Set of `https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin` to include in the matchmaking results. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/Record>>` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#getRecordTypes()()` Set of `https://developer.android.com/reference/androidx/health/connect/client/records/Record` classes to find matching apps and devices for. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#toString()()` |

## Public constructors

### MatchmakingRequest

```
public MatchmakingRequest(
    @NonNull Set<@NonNull KClass<@NonNull Record>> recordTypes,
    @NonNull Set<@NonNull DataOrigin> includedDataSources,
    @NonNull Set<@NonNull DataOrigin> excludedDataSources
)
```

## Public methods

### equals

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

### getExcludedDataSources

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
public final @NonNull Set<@NonNull DataOrigin> getExcludedDataSources()
```

Set of `https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin` to exclude from the matchmaking results. Data sources whose package names are present in this set are excluded.

Note: If a data source is an app, the calling app must have visibility of the package name (e.g. declared in the manifest inside `<queries>`). If a data source is a device, the calling app does not need to declare it in the manifest.

`https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#includedDataSources()` and `https://developer.android.com/reference/androidx/health/connect/client/matchmaking/MatchmakingRequest#excludedDataSources()` cannot both be set at the same time.

### getIncludedDataSources

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
public final @NonNull Set<@NonNull DataOrigin> getIncludedDataSources()
```

Set of `https://developer.android.com/reference/androidx/health/connect/client/records/metadata/DataOrigin` to include in the matchmaking results. If non-empty, only data sources whose package names are present in this set are considered.

### getRecordTypes

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
public final @NonNull Set<@NonNull KClass<@NonNull Record>> getRecordTypes()
```

Set of `https://developer.android.com/reference/androidx/health/connect/client/records/Record` classes to find matching apps and devices for. If empty, the flow focuses on all record types for which the calling package has permission to read.

### hashCode

```
public int hashCode()
```

### toString

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