forked from upstream-mirrors/OpenTracks
Bugfix: TrackListActivity couldn't stop and restart sensors.
Part of #1780.
This commit is contained in:
@@ -158,6 +158,7 @@ public class TrackListActivity extends AbstractTrackDeleteActivity implements Co
|
||||
} else {
|
||||
if (gpsStatusValue.isGpsStarted()) {
|
||||
recordingStatusConnection.unbindAndStop(this);
|
||||
recordingStatusConnection.startConnection(this); //TODO We need to stay listening!
|
||||
} else {
|
||||
new TrackRecordingServiceConnection((service, connection) -> {
|
||||
service.tryStartSensors();
|
||||
|
||||
@@ -125,6 +125,9 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
|
||||
if (isRecording()) {
|
||||
endCurrentTrack();
|
||||
}
|
||||
if (isSensorStarted()) {
|
||||
stopSensors();
|
||||
}
|
||||
|
||||
PreferencesUtils.unregisterOnSharedPreferenceChangeListener(this);
|
||||
|
||||
@@ -248,6 +251,7 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
|
||||
stopForeground(true);
|
||||
notificationManager.cancelNotification();
|
||||
wakeLock = SystemUtils.releaseWakeLock(wakeLock);
|
||||
gpsStatusObservable.postValue(STATUS_GPS_DEFAULT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user