MatchmakingRequest


@ExperimentalMatchmakingApi
public final 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(
    @NonNull Set<@NonNull KClass<@NonNull Record>> recordTypes,
    @NonNull Set<@NonNull DataOrigin> includedDataSources,
    @NonNull Set<@NonNull DataOrigin> excludedDataSources
)

Public methods

boolean
equals(Object other)
final @NonNull Set<@NonNull DataOrigin>

Set of DataOrigin to exclude from the matchmaking results.

final @NonNull Set<@NonNull DataOrigin>

Set of DataOrigin to include in the matchmaking results.

final @NonNull Set<@NonNull KClass<@NonNull Record>>

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

int
@NonNull String

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-alpha04
public final @NonNull Set<@NonNull DataOrigingetExcludedDataSources()

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.

getIncludedDataSources

Added in 1.2.0-alpha04
public final @NonNull Set<@NonNull DataOrigingetIncludedDataSources()

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.

getRecordTypes

Added in 1.2.0-alpha04
public final @NonNull Set<@NonNull KClass<@NonNull Record>> getRecordTypes()

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.

hashCode

public int hashCode()

toString

public @NonNull String toString()