MeasureClientExtensionKt

Added in 1.0.0

public final class MeasureClientExtensionKt


Summary

Public methods

static final @NonNull MeasureCapabilities

Returns the MeasureCapabilities of this client for the device.

static final @NonNull Void
unregisterMeasureCallback(
    @NonNull MeasureClient receiver,
    @NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType,
    @NonNull MeasureCallback callback
)

Unregisters the given MeasureCallback for updates of the given DeltaDataType.

Public methods

public static final @NonNull MeasureCapabilities getCapabilities(@NonNull MeasureClient receiver)

Returns the MeasureCapabilities of this client for the device.

This can be used to determine what DeltaDataTypes this device supports for live measurement. Clients should use the capabilities to inform their requests since Health Services will typically reject requests made for DeltaDataTypes which are not enabled for measurement.

Returns
@NonNull MeasureCapabilities

a MeasureCapabilities for this device

Throws
androidx.health.services.client.HealthServicesException

if Health Service fails to process the call

unregisterMeasureCallback

public static final @NonNull Void unregisterMeasureCallback(
    @NonNull MeasureClient receiver,
    @NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType,
    @NonNull MeasureCallback callback
)

Unregisters the given MeasureCallback for updates of the given DeltaDataType.

Parameters
@NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType

the DeltaDataType that needs to be unregistered

@NonNull MeasureCallback callback

the MeasureCallback which was used in registration

Throws
androidx.health.services.client.HealthServicesException

if Health Service fails to process the call