PassiveListenerCallback

public interface PassiveListenerCallback


A callback for receiving passive monitoring updates.

Summary

Public methods

default void

Called when a PassiveGoal has been completed.

default void

Called when a HealthEvent has been detected.

default void

Called when new DataPoints are generated.

default void

Called when the client has lost permission for the passive listener request.

default void

Called when this callback has been successfully registered with Health Services.

default void

Called when Health Services reports a failure with the registration of this callback.

default void

Called when new UserActivityInfo is generated.

Public methods

onGoalCompleted

Added in 1.0.0
default void onGoalCompleted(@NonNull PassiveGoal goal)

Called when a PassiveGoal has been completed.

Parameters
@NonNull PassiveGoal goal

the PassiveGoal that has been completed

onHealthEventReceived

Added in 1.0.0
default void onHealthEventReceived(@NonNull HealthEvent event)

Called when a HealthEvent has been detected.

Parameters
@NonNull HealthEvent event

the HealthEvent that has been detected

onNewDataPointsReceived

Added in 1.0.0
default void onNewDataPointsReceived(@NonNull DataPointContainer dataPoints)

Called when new DataPoints are generated.

Parameters
@NonNull DataPointContainer dataPoints

a list of new DataPoints generated

onPermissionLost

Added in 1.0.0
default void onPermissionLost()

Called when the client has lost permission for the passive listener request. If this happens, WHS will automatically unregister the client request and stop the relevant sensors. The client can use this callback to detect the problem and either prompt the user to re-grant the permissions or re-register while requesting only that which the app does have permission for.

onRegistered

Added in 1.0.0
default void onRegistered()

Called when this callback has been successfully registered with Health Services.

onRegistrationFailed

Added in 1.0.0
default void onRegistrationFailed(@NonNull Throwable throwable)

Called when Health Services reports a failure with the registration of this callback.

Parameters
@NonNull Throwable throwable

a Throwable sent by Health Services with information about the failure

onUserActivityInfoReceived

Added in 1.0.0
default void onUserActivityInfoReceived(@NonNull UserActivityInfo info)

Called when new UserActivityInfo is generated.

Parameters
@NonNull UserActivityInfo info

a new UserActivityInfo representing the current state