|
YAACC - UPNP Client and Server
|
What to do when a browser screen comes back to the foreground after the device or the app was suspended (screen off, Doze, a long time in the background). More...

Classes | |
| enum | ListenerCheck |
| The state of the network listener found on resume. More... | |
Static Public Member Functions | |
| static ListenerCheck | checkListener (boolean networkUsable, boolean initialized, boolean networkChanged, boolean multicastReceiving, boolean unicastReceiving) |
| static boolean | shouldSearch (boolean listenerReenabled, long lastSearchAtMillis, long nowMillis) |
What to do when a browser screen comes back to the foreground after the device or the app was suspended (screen off, Doze, a long time in the background).
No Android classes: unit-testable on the JVM.
Two decisions: whether the network listener (multicast receiver, unicast socket) is still usable or has to be re-created, and whether the devices are searched again.
|
static |
| networkUsable | a Wi-Fi, hotspot or other non-cellular network is there |
| initialized | the listener is enabled (handler and both sockets exist) |
| networkChanged | the active network differs from the one the listener was enabled on |
| multicastReceiving | the multicast receive loop is running |
| unicastReceiving | the unicast receive loop is running |
Referenced by de.yaacc.upnp.server.NetworkDeviceListener.reenableIfStale().

|
static |
| listenerReenabled | the listener was re-created just now: its new sockets know no device |
| lastSearchAtMillis | monotonic time of the last search, NEVER if none |
| nowMillis | monotonic time now (same clock) |