mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Bugfix: keep TrackRecordingService in foreground if paused.
This commit is contained in:
@@ -708,17 +708,7 @@ public class TrackRecordingService extends Service {
|
||||
}
|
||||
|
||||
private void showNotification(boolean isGpsStarted) {
|
||||
// Dijkstra If
|
||||
if (isRecording() && isPaused()) {
|
||||
stopForeground(true);
|
||||
notificationManager.cancelNotification();
|
||||
|
||||
}
|
||||
if (!isRecording() && !isGpsStarted) {
|
||||
stopForeground(true);
|
||||
notificationManager.cancelNotification();
|
||||
}
|
||||
if (isRecording() && !isPaused()) {
|
||||
if (isRecording()) {
|
||||
Intent intent = IntentUtils.newIntent(this, TrackDetailActivity.class)
|
||||
.putExtra(TrackDetailActivity.EXTRA_TRACK_ID, recordingTrackId);
|
||||
PendingIntent pendingIntent = TaskStackBuilder.create(this)
|
||||
@@ -740,5 +730,9 @@ public class TrackRecordingService extends Service {
|
||||
notificationManager.updateContent(getString(R.string.gps_starting));
|
||||
startForeground(TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.getNotification());
|
||||
}
|
||||
if (!isRecording() && !isGpsStarted) {
|
||||
stopForeground(true);
|
||||
notificationManager.cancelNotification();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user