コード例 #1
0
  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);
    }
  }
コード例 #2
0
  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);
    }
  }
コード例 #3
0
 private void doDeleteSamples() {
   persistor.deleteSamples();
   publisher.deleteSamples();
   transferManager.deleteStagedSamples();
 }