mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 18:03:06 +02:00
TrackStatisticsUpdater now provides Statistics.
Used for non-testing code.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package de.dennisguse.opentracks.stats;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
@@ -78,17 +79,17 @@ public class TrackStatisticsUpdater {
|
||||
resetAverageHeartRate();
|
||||
}
|
||||
|
||||
//TODO Return Statistic?
|
||||
@Deprecated
|
||||
public SegmentStatisticUpdater getTrackStatistics() {
|
||||
@Deprecated //TODO Remove
|
||||
@VisibleForTesting
|
||||
public SegmentStatisticUpdater getSegmentStatisticUpdater() {
|
||||
// Take a snapshot - we don't want anyone messing with our trackStatistics
|
||||
SegmentStatisticUpdater stats = new SegmentStatisticUpdater(segmentStatisticUpdater);
|
||||
stats.merge(currentSegment);
|
||||
return stats;
|
||||
}
|
||||
|
||||
public Statistics getStatistics() {
|
||||
return getTrackStatistics().getStatistics();
|
||||
public Statistics getTrackStatistics() {
|
||||
return getSegmentStatisticUpdater().getStatistics();
|
||||
}
|
||||
|
||||
public Statistics getCurrentSegment() {
|
||||
|
||||
Reference in New Issue
Block a user