SmartphoneStudyController class
Runs one SmartphoneStudy on this phone.
There is one controller per study. Use it to start and stop sampling in a single study, to listen to its measurements, or to register connected devices. Get it from SmartPhoneClientManager.getStudyController; do not create it yourself.
Key points:
- Reacts to study events. When a deployment is received, it creates the DataManager for the study's DataEndPoint, configures and connects all devices, initializes the SmartphoneDeploymentExecutor, asks for permissions and restores the previous sampling state.
- Deployment events are handled one at a time. A failing run is logged, not rethrown.
- When the deployment is stopped (e.g., on the server), it removes the study's app tasks and disposes the executor for good.
- Transforms collected
Measurements with the deployment's privacy schema and data format before they reach measurements.
See also SmartPhoneClientManager, which owns all controllers.
Constructors
- SmartphoneStudyController(SmartphoneStudy study)
-
Creates a controller for
studyand starts listening to its events.
Properties
- dataEndPoint → DataEndPoint?
-
The data endpoint of the deployment, i.e. how data is saved or uploaded.
no setter
- dataManager → DataManager?
-
The data manager that saves or uploads the measurements of this study.
no setter
- deployment → SmartphoneDeployment?
-
The deployment associated with this study.
no setter
- deploymentStatus → StudyDeploymentStatus?
-
The deployment status of this study.
no setter
- executor → SmartphoneDeploymentExecutor
-
The executor executing the deployment.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
measurements
→ Stream<
Measurement> -
The stream of all sampled measurements.
no setter
-
permissions
→ Map<
Permission, PermissionStatus> -
The status of each permission needed by this study.
no setter
- privacySchemaName → String
-
The name of the privacy schema applied to all measurements.
no setter
-
remainingDevicesToRegister
→ List<
DeviceConfiguration< DeviceRegistration> > -
The devices in this study that still need to be registered.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- study → SmartphoneStudy
-
The study that this controller runs.
no setter
Methods
-
askForAllPermissions(
) → Future< void> - Asks for the permissions needed by all measures in this study.
-
dispose(
) → void - Pauses and disposes data sampling and closes the dataManager.
-
measurementsByType(
String type) → Stream< Measurement> -
The measurements of data
type, e.g.dk.cachet.carp.steps. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void - Pauses data sampling in this study.
-
restart(
) → void - Restarts data sampling, ignoring any previously stored sampling state.
-
resume(
) → void - Resumes data sampling in this study.
-
toString(
) → String -
A string representation of this object.
inherited
-
tryRegisterConnectedDevice(
DeviceConfiguration< DeviceRegistration> device) → Future<void> -
Tries to register the connected
devicewith the deployment service. -
tryRegisterRemainingDevicesToRegister(
) → Future< void> - Tries to register all remainingDevicesToRegister.
-
tryReregisterDevice(
DeviceConfiguration< DeviceRegistration> device) → Future<void> -
Tries to re-register the
devicewith the deployment service. -
tryUnregisterDisconnectedDevice(
DeviceConfiguration< DeviceRegistration> device) → Future<void> -
Tries to unregister the
devicewith the deployment service.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited