TrackPointCreator: only try fill TrackPoint with sensor data if started.

This commit is contained in:
Dennis Guse
2021-12-27 23:19:56 +01:00
parent c7bbaddc06
commit d6cc7a0321
@@ -58,6 +58,10 @@ public class TrackPointCreator {
altitudeSumManager.start(context);
}
private boolean isStarted() {
return context != null;
}
@Deprecated
//There should be a cooler way to do this; we want to send fake locations without getting affected by real GPS data.
@VisibleForTesting
@@ -75,6 +79,10 @@ public class TrackPointCreator {
}
private SensorDataSet fill(TrackPoint trackPoint) {
if (!isStarted()) {
Log.w(TAG, "Not started, should not be called.");
return null;
}
SensorDataSet sensorDataSet = remoteSensorManager.fill(trackPoint);
altitudeSumManager.fill(trackPoint);