mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-10 13:13:05 +02:00
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 {
|
} else {
|
||||||
if (gpsStatusValue.isGpsStarted()) {
|
if (gpsStatusValue.isGpsStarted()) {
|
||||||
recordingStatusConnection.unbindAndStop(this);
|
recordingStatusConnection.unbindAndStop(this);
|
||||||
|
recordingStatusConnection.startConnection(this); //TODO We need to stay listening!
|
||||||
} else {
|
} else {
|
||||||
new TrackRecordingServiceConnection((service, connection) -> {
|
new TrackRecordingServiceConnection((service, connection) -> {
|
||||||
service.tryStartSensors();
|
service.tryStartSensors();
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
|
|||||||
if (isRecording()) {
|
if (isRecording()) {
|
||||||
endCurrentTrack();
|
endCurrentTrack();
|
||||||
}
|
}
|
||||||
|
if (isSensorStarted()) {
|
||||||
|
stopSensors();
|
||||||
|
}
|
||||||
|
|
||||||
PreferencesUtils.unregisterOnSharedPreferenceChangeListener(this);
|
PreferencesUtils.unregisterOnSharedPreferenceChangeListener(this);
|
||||||
|
|
||||||
@@ -248,6 +251,7 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
|
|||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
notificationManager.cancelNotification();
|
notificationManager.cancelNotification();
|
||||||
wakeLock = SystemUtils.releaseWakeLock(wakeLock);
|
wakeLock = SystemUtils.releaseWakeLock(wakeLock);
|
||||||
|
gpsStatusObservable.postValue(STATUS_GPS_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user