Skip to content

BackgroundSensingUserTask

A user task without UI that collects sensor data in the background.

E.g. noise.

Sensing starts on onStart and stops on onDone. Created by the SensingUserTaskFactory for app tasks of type AppTask.SENSING_TYPE.

Inheritance

Constructors

BackgroundSensingUserTask

BackgroundSensingUserTask(
  1. AppTaskExecutor<AppTask> executor
)

Methods

onDone

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

Called by the app when the user has finished this task.

Sets result, doneTime and state, and marks the task as done in the AppTaskController. If dequeue is true the task is also removed from the queue.

onNotification

void onNotification()
override

Starts the background sensing when the user taps the notification.

When the background sensing pauses, the task is marked as done.

onStart

void onStart()
override

Called by the app when the user starts this task.

Initializes backgroundTaskExecutor and sets state to UserTaskState.started.