PassiveListenerCallback


interface PassiveListenerCallback


A callback for receiving passive monitoring updates.

Summary

Public functions

open Unit

Called when a PassiveGoal has been completed.

open Unit

Called when a HealthEvent has been detected.

open Unit

Called when new DataPoints are generated.

open Unit

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

open Unit

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

open Unit

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

open Unit

Called when new UserActivityInfo is generated.

Public functions

onGoalCompleted

Added in 1.0.0
open fun onGoalCompleted(goal: PassiveGoal): Unit

Called when a PassiveGoal has been completed.

Parameters
goal: PassiveGoal

the PassiveGoal that has been completed

onHealthEventReceived

Added in 1.0.0
open fun onHealthEventReceived(event: HealthEvent): Unit

Called when a HealthEvent has been detected.

Parameters
event: HealthEvent

the HealthEvent that has been detected

onNewDataPointsReceived

Added in 1.0.0
open fun onNewDataPointsReceived(dataPoints: DataPointContainer): Unit

Called when new DataPoints are generated.

Parameters
dataPoints: DataPointContainer

a list of new DataPoints generated

onPermissionLost

Added in 1.0.0
open fun onPermissionLost(): Unit

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
open fun onRegistered(): Unit

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

onRegistrationFailed

Added in 1.0.0
open fun onRegistrationFailed(throwable: Throwable): Unit

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

Parameters
throwable: Throwable

a Throwable sent by Health Services with information about the failure

onUserActivityInfoReceived

Added in 1.0.0
open fun onUserActivityInfoReceived(info: UserActivityInfo): Unit

Called when new UserActivityInfo is generated.

Parameters
info: UserActivityInfo

a new UserActivityInfo representing the current state