Play policy · foreground service permission
FOREGROUND_SERVICE_DATA_SYNC — how Code SSH uses it
Demonstration video for the Play Console foreground service declaration. The recording shows the exact user journey that triggers the service, the notification the user sees while it runs, and the behavior that justifies the dataSync type.
What the video shows
App home — host list
The user picks a saved SSH host. Opening a session is the only thing that starts the foreground service — it never runs at boot or in the background without a session.
Session opens → foreground service starts
While the SSH connection is established, the app starts a foreground service with the dataSync type and immediately posts a silent, low-priority notification ("Code SSH — 1 sessions") so the user always knows it is running.
Working with a coding agent
The terminal runs an interactive session on the user’s own server (here a Claude Code-style agent). Long-running agent tasks stream output continuously over the SSH connection.
App goes to the background
The user presses Home. Without the foreground service, Android could kill the process and drop the SSH socket — killing any running agent task.
User-visible notification
The persistent "Code SSH — 1 sessions" notification is visible in the notification shade the whole time the service runs. This is how the user is made aware of, and can always find, the active background session.
Return — session still alive
Reopening the app restores the same session instantly. Running a new command proves the connection stayed alive: output comes back from the server after ~9 seconds in the background.
Service stops with the session
When the last session closes (user types exit or closes the tab), the foreground service stops and the notification is removed. No part of the service outlives the user’s session.
Service behavior
Why dataSync
The service keeps an interactive SSH terminal synchronized with the user’s server — streaming command output, agent progress, and notifications while the screen is off or another app is in front. This is continuous, user-initiated data flow over the user’s own connection, which is what the dataSync type covers.
User awareness
The service runs with a silent, low-importance notification (channel "Background session") that is present for its entire lifetime and shows the number of open sessions. It makes no sound and shows no content from the session.
No data leaves the device
The service only keeps the process alive. All terminal data travels over the SSH connection the user configured, directly from the device to their server — there is no relay, no analytics, and no operator-run server involved.
Technical reference: the service is declared as android:foregroundServiceType="dataSync" on the session-keeper service and is started only while at least one SSH session is open (notification: “Code SSH — N sessions”, channel “Background session”, importance LOW, silent). Recording made on the release build; the SSH server in the video is a local test server.