mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 11:01:07 +00:00
fix(session): cancel a session start that is still setting up
This commit is contained in:
1 parent
6e25e0b007
commit
1ea8eb6cb3
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