private void doEnableRecording() { connectorThread.addConsumer(persistor); isRecording = true; final Tag tagStartRecording = new Tag( System.currentTimeMillis(), GlobalContext.getUserId(), IntentAPI.VALUE_START_RECORDING); persistor.push(tagStartRecording); // API EXTENSIONS are triggered on together with recording if (API_EXTENSIONS) { publisher.push(tagStartRecording); connectorThread.addConsumer(publisher); connectorThread.addConsumer(gpsCache); } }
private void doDisableRecording() { connectorThread.removeConsumer(persistor); isRecording = false; final Tag stopRecordingTag = new Tag( System.currentTimeMillis(), GlobalContext.getUserId(), IntentAPI.VALUE_STOP_RECORDING); persistor.push(stopRecordingTag); // API EXTENSIONS are triggered on together with recording if (API_EXTENSIONS) { // Add "STOP RECORDING TAG" to publisher publisher.push(stopRecordingTag); connectorThread.removeConsumer(publisher); connectorThread.removeConsumer(gpsCache); } }
private void doDeleteSamples() { persistor.deleteSamples(); publisher.deleteSamples(); transferManager.deleteStagedSamples(); }