forked from upstream-mirrors/OpenTracks
Recording data from BLE sensors alone (need to provide distance).
GPS is optional in this case, but no coordinates will be available. Naive implementation tries to store data every second using the UI timer. Part of #500.
This commit is contained in:
@@ -158,6 +158,10 @@ public class GPSHandler implements LocationListener, GpsStatus.GpsStatusListener
|
||||
return lastTrackPoint;
|
||||
}
|
||||
|
||||
Distance getThresholdHorizontalAccuracy() {
|
||||
return thresholdHorizontalAccuracy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from {@link GpsStatus} to inform that GPS status has changed from prevStatus to currentStatus.
|
||||
*
|
||||
|
||||
@@ -101,7 +101,7 @@ public class TrackPointCreator {
|
||||
gpsHandler.onSharedPreferenceChanged(key);
|
||||
}
|
||||
|
||||
public void onNewTrackPoint(TrackPoint trackPoint, Distance thresholdHorizontalAccuracy) {
|
||||
public synchronized void onNewTrackPoint(@NonNull TrackPoint trackPoint, @NonNull Distance thresholdHorizontalAccuracy) {
|
||||
fill(trackPoint);
|
||||
|
||||
boolean stored = service.newTrackPoint(trackPoint, thresholdHorizontalAccuracy);
|
||||
@@ -110,6 +110,10 @@ public class TrackPointCreator {
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewTrackPointWithoutGPS() {
|
||||
onNewTrackPoint(new TrackPoint(TrackPoint.Type.SENSORPOINT, createNow()), gpsHandler.getThresholdHorizontalAccuracy());
|
||||
}
|
||||
|
||||
public TrackPoint createSegmentStartManual() {
|
||||
return TrackPoint.createSegmentStartManualWithTime(createNow());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user