コード例 #1
0
  @Override
  public void onDestroy() {
    log.debug("Called onDestroy()");

    persistor.close();

    executorService.shutdown();

    super.onDestroy();
  }
コード例 #2
0
 public void doSendStatus() {
   Intent intent = new Intent(IntentAPI.RETURN_STATUS);
   intent.putExtra(IntentAPI.FIELD_SAMPLING, isRecording);
   intent.putExtra(IntentAPI.FIELD_TRANSFERRING, transferManager.isTransferring());
   intent.putExtra(
       IntentAPI.FIELD_SAMPLES_STORED,
       persistor.hasSamples() | transferManager.hasStagedSamples());
   intent.putExtra(ExtendedIntentAPI.FIELD_STREAMING, isStreaming);
   intent.putExtra(IntentAPI.FIELD_HAR, isHAR);
   intent.putExtra(IntentAPI.FIELD_USER_ID, userId);
   sendBroadcast(intent);
 }
コード例 #3
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);
    }
  }
コード例 #4
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);
    }
  }
コード例 #5
0
 private void doDeleteSamples() {
   persistor.deleteSamples();
   publisher.deleteSamples();
   transferManager.deleteStagedSamples();
 }