Skip to content

HealthUserTask

A UserTask without UI that collects health data when the user starts it.

Created by the HealthUserTaskFactory for a HealthAppTask. On start, it asks its HealthProbe to request permission for the health data types, resumes data collection, and marks itself done 30 seconds later. If permission is denied or the task has no health probe, it logs a warning and collects nothing. When done, it pauses data collection again.

Inheritance

Constructors

HealthUserTask

HealthUserTask(
  1. AppTaskExecutor<AppTask> executor
)

Properties

healthAppTask

HealthAppTask get healthAppTask

The HealthAppTask which specifies which health data to collect.

Methods

onDone

void onDone({
  1. bool dequeue = false,
  2. Data? result,
})
override

Callback from the app when this task is done.

If dequeue is true the task is removed from the queue. result can specify the result obtained from this task, if available.

onStart

void onStart()
override

Callback from the app when this task is to be started.