mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 17:43:06 +02:00
Bugfix: PublicAPI stop should not start TrackRecordingService in foreground.
Actually, TrackRecordingService will start in foreground if needed. Fixes #1850.
This commit is contained in:
+3
-3
@@ -26,7 +26,6 @@ import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import de.dennisguse.opentracks.BuildConfig;
|
||||
|
||||
@@ -81,7 +80,8 @@ public class TrackRecordingServiceConnection {
|
||||
}
|
||||
|
||||
Log.i(TAG, "Binding the service.");
|
||||
int flags = BuildConfig.DEBUG ? Context.BIND_DEBUG_UNBIND : 0;
|
||||
|
||||
int flags = Context.BIND_AUTO_CREATE + (BuildConfig.DEBUG ? Context.BIND_DEBUG_UNBIND : 0);
|
||||
context.bindService(new Intent(context, TrackRecordingService.class), serviceConnection, flags);
|
||||
}
|
||||
|
||||
@@ -142,6 +142,6 @@ public class TrackRecordingServiceConnection {
|
||||
new TrackRecordingServiceConnection(withUnbind)
|
||||
.bind(context);
|
||||
|
||||
ContextCompat.startForegroundService(context, new Intent(context, TrackRecordingService.class));
|
||||
// ContextCompat.startForegroundService(context, new Intent(context, TrackRecordingService.class));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user