Cleanup: Statistics doesn't need isIdle.

isIdle is only used by SegmentStatisticsUpdater.
This commit is contained in:
Dennis Guse
2025-10-30 21:52:00 +01:00
parent 73ce97a63e
commit 696939112a
14 changed files with 23 additions and 42 deletions
@@ -146,8 +146,6 @@ public class ContentProviderUtils {
cursor.isNull(totalDistanceIndex) ? null : Distance.of(cursor.getFloat(totalDistanceIndex)),
false,
cursor.isNull(maxSpeedIndex) ? null : Speed.of(cursor.getFloat(maxSpeedIndex)),
cursor.isNull(minAltitudeIndex) || cursor.isNull(maxAltitudeIndex) ? null : new AltitudeExtremities(cursor.getFloat(minAltitudeIndex), cursor.getFloat(maxAltitudeIndex)),
cursor.isNull(altitudeGainIndex) || cursor.isNull(altitudeLossIndex) ? null : new AltitudeGainLoss(cursor.getFloat(altitudeGainIndex), cursor.getFloat(altitudeLossIndex)),
@@ -14,7 +14,7 @@ public record Statistics(
Duration movingTime, // Based on when we believe the user is traveling
Distance totalDistance,
boolean isIdle, //TODO Check if this is persisted; if not: remove
//TODO Check if this is persisted; if not: remove
Speed maxSpeed,
@Nullable
@@ -92,7 +92,7 @@ public class TrackFilenameGenerator {
Track track = new Track();
track.setName("Berlin");
track.setUuid(UUID.fromString("f81d4fae-7dec-11d0-a765-00a0c91e6bf6"));
track.setStatistics(new Statistics(Instant.MIN, null, null, null, null, false, null, null, null, null, null));
track.setStatistics(new Statistics(Instant.MIN, null, null, null, null, null, null, null, null, null));
return format(track, TrackFileFormat.KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES);
}
@@ -81,6 +81,7 @@ public class SegmentStatisticUpdater {
*/
public SegmentStatisticUpdater(SegmentStatisticUpdater other) {
this(other.getStatistics());
this.isIdle = other.isIdle();
}
public SegmentStatisticUpdater(Statistics statistics) {
@@ -99,7 +100,6 @@ public class SegmentStatisticUpdater {
}
avgHeartRate = statistics.avgHeartRate();
avgPower = statistics.avgPower();
isIdle = statistics.isIdle();
}
/**
@@ -208,7 +208,6 @@ public class SegmentStatisticUpdater {
movingTime,
totalDistance,
isIdle,
getMaxSpeed(),
altitudeExtremities.hasData() ? new AltitudeExtremities(altitudeExtremities.getMin(), altitudeExtremities.getMax()) : null,
totalAltitudeGain_m != null && totalAltitudeLoss_m != null ? new AltitudeGainLoss(totalAltitudeGain_m, totalAltitudeLoss_m) : null,
@@ -46,7 +46,6 @@ public class SettingsCustomLayoutEditAdapter extends RecyclerView.Adapter<Recycl
Duration.ofMinutes(0),
Distance.of(0),
false,
Speed.of(0),
null,