forked from upstream-mirrors/OpenTracks
StatisticsRecordingFragment: set speed=0 when TrackPoint is outdated.
This commit is contained in:
@@ -111,6 +111,12 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (isResumed() && isSelectedTrackRecording()) {
|
if (isResumed() && isSelectedTrackRecording()) {
|
||||||
if (!isSelectedTrackPaused() && lastTrackStatistics != null) {
|
if (!isSelectedTrackPaused() && lastTrackStatistics != null) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (lastTrackPoint != null && lastTrackPoint.hasLocation() && !lastTrackPoint.isRecent()) {
|
||||||
|
lastTrackPoint = null;
|
||||||
|
setLocationValues();
|
||||||
|
}
|
||||||
|
}
|
||||||
updateTotalTime();
|
updateTotalTime();
|
||||||
updateSensorDataUI();
|
updateSensorDataUI();
|
||||||
}
|
}
|
||||||
@@ -222,16 +228,18 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
|
|||||||
if (isResumed()) {
|
if (isResumed()) {
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
if (isResumed()) {
|
if (isResumed()) {
|
||||||
this.lastTrackPoint = newLastTrackPoint;
|
synchronized (this) {
|
||||||
|
this.lastTrackPoint = newLastTrackPoint;
|
||||||
|
|
||||||
if (!isSelectedTrackRecording() || isSelectedTrackPaused()) {
|
if (!isSelectedTrackRecording() || isSelectedTrackPaused()) {
|
||||||
this.lastTrackPoint = null;
|
this.lastTrackPoint = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.lastTrackPoint != null && this.lastTrackPoint.hasLocation() && !this.lastTrackPoint.isRecent()) {
|
if (this.lastTrackPoint != null && this.lastTrackPoint.hasLocation() && !this.lastTrackPoint.isRecent()) {
|
||||||
this.lastTrackPoint = null;
|
this.lastTrackPoint = null;
|
||||||
|
}
|
||||||
|
setLocationValues();
|
||||||
}
|
}
|
||||||
setLocationValues();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user