mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Bugfix: prevent crash while stopping recording (race condition).
Part of #1328
This commit is contained in:
@@ -267,10 +267,11 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
|
||||
|
||||
@Override
|
||||
public void newGpsStatus(GpsStatusValue gpsStatusValue) {
|
||||
notificationManager.updateContent(getString(gpsStatusValue.message));
|
||||
|
||||
//TODO This check should not be necessary, but prevents a crash; somehow the shutdown is not working correctly as we should not receive a notification then.
|
||||
// It is likely a race condition as the LocationManager provides location updates without using the Handler.
|
||||
if (gpsStatusObservable != null) {
|
||||
notificationManager.updateContent(getString(gpsStatusValue.message));
|
||||
gpsStatusObservable.postValue(gpsStatusValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user