Android14: crash due to missing announcement of ForegroundServiceType.

Fixes #1655.
This commit is contained in:
Dennis Guse
2023-08-06 10:51:25 +02:00
parent 45f41d6401
commit 971b0196da
2 changed files with 3 additions and 1 deletions
@@ -208,7 +208,7 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
wakeLock = SystemUtils.acquireWakeLock(this, wakeLock);
trackPointCreator.start(this, handler);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.setGPSonlyStarted(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
startForeground(TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.setGPSonlyStarted(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION + ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
} else {
startForeground(TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.setGPSonlyStarted(this));
}