MatchmakingRequest


@ExperimentalMatchmakingApi
class MatchmakingRequest


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 HealthConnectFeatures.getFeatureStatus and pass HealthConnectFeatures.Companion.FEATURE_MATCHMAKING as an argument.

Summary

Public constructors

MatchmakingRequest(
    recordTypes: Set<KClass<Record>>,
    includedDataSources: Set<DataOrigin>,
    excludedDataSources: Set<DataOrigin>
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Set<DataOrigin>

Set of DataOrigin to exclude from the matchmaking results.

Set<DataOrigin>

Set of DataOrigin to include in the matchmaking results.

Set<KClass<Record>>

Set of androidx.health.connect.client.records.Record classes to find matching apps and devices for.

Public constructors

MatchmakingRequest

MatchmakingRequest(
    recordTypes: Set<KClass<Record>> = emptySet(),
    includedDataSources: Set<DataOrigin> = emptySet(),
    excludedDataSources: Set<DataOrigin> = emptySet()
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

excludedDataSources

Added in 1.2.0-alpha04
val excludedDataSourcesSet<DataOrigin>

Set of 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.

includedDataSources and excludedDataSources cannot both be set at the same time.

includedDataSources

Added in 1.2.0-alpha04
val includedDataSourcesSet<DataOrigin>

Set of DataOrigin to include in the matchmaking results. If non-empty, only data sources whose package names are present in this set are considered.

recordTypes

Added in 1.2.0-alpha04
val recordTypesSet<KClass<Record>>

Set of 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.