runtime library

The CAMS runtime layer: executes studies on the phone.

SmartPhoneClientManager is the main entry point. It holds a SmartphoneStudyController for each study, which runs the study's deployment with a SmartphoneDeploymentExecutor. The DeviceController holds a DeviceManager for each connected device, the SamplingPackageRegistry holds the registered sampling packages and their probes, and the AppTaskController holds the queue of UserTasks.

Classes

AbstractExecutor<TConfig>
The base class for all executors in CAMS.
AggregateExecutor<TConfig>
An executor that runs a set of child executors.
AppLifecycleTriggerExecutor
Runs an AppLifecycleTrigger: fires when the app enters a listed state.
AppTaskControlExecutor
Runs a TaskControl with an AppTask and a Schedulable trigger.
AppTaskController
Keeps the queue of UserTasks that the user needs to do.
AppTaskExecutor<TConfig extends AppTask>
Runs an AppTask by putting it on the AppTaskController queue.
BackgroundSensingUserTask
A user task without UI that collects sensor data in the background.
BackgroundTaskExecutor
Runs a BackgroundTask by creating and running one Probe per measure.
BLEDeviceManager<TDeviceConfiguration extends BLEDevice<TRegistration>, TRegistration extends BLEDeviceRegistration>
A device manager for a Bluetooth Low Energy (BLE) device.
BufferingIntervalStreamProbe
A probe that buffers a bufferingStream and emits one measurement per interval.
BufferingPeriodicProbe
A probe that collects data in sampling windows, one measurement per window.
BufferingPeriodicStreamProbe
A probe that buffers a bufferingStream in sampling windows.
ConditionalPeriodicTriggerExecutor
Runs a ConditionalPeriodicTrigger: fires when its condition returns true.
ConditionalSamplingEventTriggerExecutor
Runs a ConditionalSamplingEventTrigger: fires on matching measurements.
Cron
Parses cron expressions into an iterator of matching dates.
CronScheduledTriggerExecutor
Runs a CronScheduledTrigger: fires at the times of its cron expression.
DateTimeTriggerExecutor
Runs a DateTimeTrigger: fires once at the specified date and time.
DelayedTriggerExecutor
Runs a DelayedTrigger, i.e. fires once, a delay after it is resumed.
DeviceController
Keeps the DeviceManager of every device and service on this phone.
DeviceManager<TDeviceConfiguration extends DeviceConfiguration<TRegistration>, TRegistration extends DeviceRegistration>
Manages one device or service used for data collection.
ElapsedTimeTriggerExecutor
Runs an ElapsedTimeTrigger, i.e. fires once, a set time after deployment.
Executor<TConfig>
Runs one part of a deployment, configured by a TConfig.
ExecutorFactory
Creates and caches the trigger and task executors of all deployments.
FunctionTaskExecutor
Runs a FunctionTask by calling its function each time it is resumed.
HardwareDeviceManager<TDeviceConfiguration extends DeviceConfiguration<TRegistration>, TRegistration extends DeviceRegistration>
A DeviceManager for a hardware device with a battery.
HasNext<E>
Something that can step forward to the next value, e.g. a CronIterator.
HasPrevious<E>
Something that can step back to the previous value, e.g. a CronIterator.
ImmediateTriggerExecutor
Runs an ImmediateTrigger, i.e. fires each time it is resumed.
IntervalProbe
A probe that collects a Measurement with getMeasurement at an interval.
MeasurementProbe
A probe that collects one Measurement when resumed, then pauses itself.
NoOpTriggerExecutor
Runs a NoOpTrigger, i.e. never fires.
NoUserTaskTriggerExecutor
Runs a NoUserTaskTrigger: fires when its task is not on the task queue.
OneTimeTriggerExecutor
Runs a OneTimeTrigger, i.e. fires only once per study deployment.
PassiveTriggerExecutor
Runs a PassiveTrigger, which the app fires from code.
PeriodicStreamProbe
A StreamProbe that listens to its stream only in sampling windows.
PeriodicTriggerExecutor
Runs a PeriodicTrigger: fires when resumed, then once per period.
Probe
Collects data for one Measure.
RandomRecurrentTriggerExecutor
Runs a RandomRecurrentTrigger: fires a random number of times per day.
RecurrentScheduledTriggerExecutor
Runs a RecurrentScheduledTrigger, e.g. every Monday at 9:00.
SamplingEventTriggerExecutor
Runs a SamplingEventTrigger: fires on matching measurements in the study.
SamplingPackageRegistry
The singleton registry of all SamplingPackages used in an app.
SamplingState
A serializable snapshot of an Executor's ExecutorState.
SchedulableTriggerExecutor<TConfig extends TriggerConfiguration>
A TriggerExecutor for a Schedulable trigger.
SensingUserTaskFactory
The default UserTaskFactory, for AppTask.SENSING_TYPE app tasks.
ServiceManager<TDeviceConfiguration extends ServiceConfiguration<TRegistration>, TRegistration extends ServiceRegistration>
A DeviceManager for a software service, like a location or weather service.
SmartPhoneClientManager
The main entry point of CARP Mobile Sensing (CAMS) on the phone.
SmartphoneClientRepository
Stores the studies of the SmartPhoneClientManager on the phone.
SmartphoneDeploymentExecutor
Runs a SmartphoneDeployment: the root of the executor tree of a study.
SmartphoneDeploymentExecutorSamplingState
The sampling state of a SmartphoneDeploymentExecutor and its task controls.
SmartphoneDeviceManager
The device manager for this phone, the primary device.
SmartphoneStudyController
Runs one SmartphoneStudy on this phone.
SmartphoneTriggerFactory
The TriggerFactory for all triggers that come with CAMS.
StreamProbe
A probe that forwards every Measurement from a stream while resumed.
StubProbe
A probe that does nothing. Useful as a placeholder, e.g. in tests.
TaskControlExecutor
Runs a TaskControl: starts or stops a task each time its trigger fires.
TaskControlExecutorSamplingState
The sampling state of one TaskControlExecutor.
TaskExecutor<TConfig extends TaskConfiguration>
Runs a TaskConfiguration when its trigger fires.
TriggerEvent
An event emitted on TriggerExecutor.triggerEvents when the trigger fires.
TriggerExecutor<TConfig extends TriggerConfiguration>
Runs a TriggerConfiguration: decides when its task should start or stop.
TriggerFactory
Creates a TriggerExecutor for a TriggerConfiguration by runtime type.
UserTask
A task the user needs to do, e.g. fill in a survey.
UserTaskBufferItem
An app task waiting in the AppTaskController buffer to be enqueued.
UserTaskFactory
Creates a UserTask for an AppTask, based on AppTask.type.
UserTaskSnapshot
A serializable snapshot of a UserTask.
UserTaskTriggerExecutor
Runs a UserTaskTrigger: fires when a matching UserTask changes state.

Enums

ClientManagerState
The lifecycle states of the SmartPhoneClientManager, in order.
DeviceStatus
The runtime status of a DeviceManager and its device.
ExecutorState
The runtime state of an Executor.
UserTaskState
The states of a UserTask.

Mixins

CronIterator<E>
Steps through the dates matching a cron expression.

Functions

requestPermissionsInOrder(List<Permission> permissions) → Future<void>
Requests permissions one at a time, skipping those already granted.

Typedefs

PermissionRequester = Future<void> Function(List<Permission> permissions)
A function that asks the user for a list of permissions.