mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-12 19:41:10 +00:00
fix(session): cancel a session start that is still setting up
This commit is contained in:
1 file changed
+6
@@ -1158,6 +1158,12 @@ class SessionService : Service() {
|
||||
}
|
||||
|
||||
fun stop(context: Context) {
|
||||
// Not running yet (still downloading or setting up): the start path checks this flag
|
||||
// and cancels, and a service started here would have no session to stop.
|
||||
if (!SessionState.running) {
|
||||
SessionState.stopRequested = true
|
||||
return
|
||||
}
|
||||
context.startService(Intent(context, SessionService::class.java).setAction(ACTION_STOP))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user