stopForegroundService

fun stopForegroundService(forSleep: Boolean = false)

Stops the foreground service and removes the notification. Can be called from inside or outside the service.

Parameters

forSleep

If true, the current route/beacon playback state is persisted so it can be automatically resumed when the service is next started (used by sleep mode).