Skip to content

runtime

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

Enums

Mixins

  • CronIterator — Steps through the dates matching a cron expression.

Functions

requestPermissionsInOrder

Future<void> requestPermissionsInOrder(
  1. List<Permission> permissions
)

Requests permissions one at a time, skipping those already granted.

This is the default PermissionRequester.

One at a time is not a style choice: Android denies - without showing a dialog - any request made while another one is up, and a permission that unlocks another one can only be granted if asked first.

Typedefs

PermissionRequester

PermissionRequester = Future<void> Function(List<Permission> permissions)

A function that asks the user for a list of permissions.

It completes once the user has answered. Lets an app take over how permissions are requested, e.g., to show a rationale before each system dialog. Pass it to SmartPhoneClientManager.configure.

Whatever the user answers, CAMS re-checks the actual permission status afterwards, so a requester never needs to report back.

A requester runs inside the permission queue, so it must call permission_handler directly and never SmartPhoneClientManager.requestPermissions - that would wait on itself.