forked from upstream-mirrors/OpenTracks
@@ -1,11 +1,24 @@
|
||||
package de.dennisguse.opentracks.publicapi;
|
||||
|
||||
import de.dennisguse.opentracks.data.models.Track;
|
||||
import de.dennisguse.opentracks.services.RecordingData;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingService;
|
||||
import de.dennisguse.opentracks.util.ExportUtils;
|
||||
|
||||
public class StopRecording extends AbstractAPIActivity {
|
||||
|
||||
protected void execute(TrackRecordingService service) {
|
||||
RecordingData recordingData = service.getRecordingDataObservable().getValue();
|
||||
Track.Id trackId = null;
|
||||
if (recordingData != null && recordingData.getTrack() != null) {
|
||||
trackId = recordingData.getTrack().getId();
|
||||
}
|
||||
|
||||
service.endCurrentTrack();
|
||||
|
||||
if (trackId != null) {
|
||||
ExportUtils.postWorkoutExport(this, trackId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user