dispose method
Pauses and disposes data sampling and closes the dataManager.
Closing the data manager e.g. flushes data to a file. All cached deployment information and any data sampled in this deployment remain on the phone.
The controller must not be used afterwards. Called by SmartPhoneClientManager when a study is stopped or removed.
Implementation
@mustCallSuper
void dispose() {
info('$runtimeType - Disposing study from this smartphone...');
pause();
// Disposing unregisters the executors from the device managers - otherwise
// they resume along with a later study using the same deployment id.
executor.dispose();
dataManager?.close();
}