mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 09:53:06 +02:00
Several fixes to the service and more test coverage.
Notably: 1) Fixed isRecording to not return false if service is down (for instance, it may be being restarted) 2) Added more checks to prevent from invalid starting/stopping (if in already in progress/not started).
This commit is contained in:
@@ -298,13 +298,13 @@ public class ChartActivity extends Activity implements
|
||||
public void onChange(boolean selfChange) {
|
||||
Log.d(MyTracksConstants.TAG, "ChartActivity: ContentObserver.onChange");
|
||||
// Check for any new locations and append them to the currently
|
||||
// recording track:
|
||||
if (!MyTracks.getInstance().isRecording()) {
|
||||
// recording track.
|
||||
if (recordingTrackId < 0) {
|
||||
// No track is being recorded. We should not be here.
|
||||
return;
|
||||
}
|
||||
if (selectedTrackId != recordingTrackId) {
|
||||
// no track, or one other than the recording track is selected, don't
|
||||
// No track, or one other than the recording track is selected, don't
|
||||
// bother.
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user