|
YAACC - UPNP Client and Server
|
Groups running player sessions under the receiver device they play on. More...

Static Public Member Functions | |
| static List< Row > | group (List< String > receiverDeviceIds, List< PlayerRef > players) |
| Receivers in the given order, each followed by its sessions, oldest first (ascending creation sequence); sessions with an unknown deviceId go last, grouped per device. | |
| static PlayerRef | primarySession (String deviceId, List< PlayerRef > players) |
| Among the device's playing sessions, the newest (highest creation sequence); if none is playing, the newest session overall; null if the device has no sessions. | |
Groups running player sessions under the receiver device they play on.
Receivers and players are not 1:1 (a device can run several players at once), so the result is an ordered list of receiver rows, each followed by zero or more session rows.
Deliberately has no android.* imports - same testability precedent as CardGridSpanCount - so it can be unit-tested on the plain JVM without Robolectric.
Device ids come from untrusted LAN devices (SSDP/UDN), so they are treated as opaque strings: UpnpClient.LOCAL_UID gets no special handling, a duplicate receiver id is only listed at its first occurrence, and a null id never throws.
|
static |
Receivers in the given order, each followed by its sessions, oldest first (ascending creation sequence); sessions with an unknown deviceId go last, grouped per device.
Never drops a session.
Unknown-device sessions get no RECEIVER row (the caller labels them from Row#deviceId()); their device groups are ordered by each group's oldest session. Equal sequences fall back to playerId so the result never depends on input order. A duplicate receiver id is listed only at its first occurrence, a null receiver id is skipped, and sessions with a null deviceId form their own trailing group. With no receivers at all, every session is still listed. null lists are treated as empty.
|
static |
Among the device's playing sessions, the newest (highest creation sequence); if none is playing, the newest session overall; null if the device has no sessions.
Independent of input order (players arrive in HashMap order); equal sequences fall back to the higher playerId.