Repository navigation
feat(android): keep ssh sessions alive in the background - #5
Merged
Merged
Conversation
Android runs a specialUse foreground service while at least one session is open, with an ongoing notification whose texts come from JavaScript and a disconnect action that closes every session natively. notifyWhenIdle reports a command that finished while the app is off screen. iOS resolves the same calls without a keepalive.
Keeps both sides: the background session events, service wiring and JS API coexist with the SFTP, transfer and forwarding APIs and the jump-host connect path. The session counter still bounds the foreground service, and every SFTP client or forward requires an open session, so those paths keep it running.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeps SSH sessions alive on Android while the app is in the background, using a foreground service of type specialUse with an ongoing notification and a Disconnect all action. Adds a one-shot idle notification for a shell whose command finishes while the app is in the background. Notification texts come from JavaScript so apps can localise them. The config plugin adds the manifest entries; iOS exposes the same API as no-ops, because iOS does not allow background sockets.
Verified on an Android emulator against the OpenSSH test container: the same TCP connection stays established after twelve minutes in the background and the shell keeps working on return; the idle notification fires only while backgrounded; Disconnect all closes every session and stops the service. The macOS CI job verifies the iOS build.