The phone as a Snapcast client, for the listen test (task 8.1): a foreground service of type mediaPlayback that owns the SnapcastConnection, the ClientEngine and the output while a session runs.
More...
|
| static void | start (Context context, String hostText, int latencyMs) |
| | Starts a session.
|
| |
| static void | start (Context context, String hostText, int latencyMs, int writeAheadMs) |
| |
| static void | start (Context context, String hostText, int latencyMs, int writeAheadMs, boolean flacGuard) |
| |
|
static void | stop (Context context) |
| | Ends the session, if there is one.
|
| |
|
static void | setLatency (Context context, int latencyMs) |
| | Changes the manual latency of the running session.
|
| |
The phone as a Snapcast client, for the listen test (task 8.1): a foreground service of type mediaPlayback that owns the SnapcastConnection, the ClientEngine and the output while a session runs.
Lifetime. It is started by the app (the screen, the switch on the first page, the checkbox of the settings, the restore at the start of the app; all through SnapcastClientPower). The system never restarts it (START_NOT_STICKY, not exported) and it lives only while a session is on. A wake lock (partial, with a safety timeout of 8 hours, renewed while the session runs) and a Wi-Fi lock are taken at the start and released at every end: the stop button, an error of the connection or of the engine, the watchdog, and onDestroy. The notification is the standard one with a Stop action. No listener socket is opened; the phone connects out to the one server the user typed in, by an address resolved once.
Disclosure. The Hello carries the name of the phone as the UPnP server announces it, the program name, the generic words "Android" and "unknown", and an id derived from a secret of this installation (SnapcastClientIdentity): the same id for every server; the MAC is the fixed placeholder. Nothing from the server is written to the log.