|
YAACC - UPNP Client and Server
|
Which locks the service takes and when it renews them. More...

Which locks the service takes and when it renews them.
Pure, so the decisions are tested; the service only calls the platform.
Wi-Fi. WIFI_MODE_FULL_HIGH_PERF (3) keeps Wi-Fi out of power save also with the screen off. The platform replaced it from Android 14 (API 34) by WIFI_MODE_FULL_LOW_LATENCY (4), which per its documentation is active only while the screen is on and the app is in the foreground. So up to API 33 the high-performance lock is the one that does what a screen-off session needs; from API 34 no lock exists that holds Wi-Fi out of power save with the screen off, and the session depends on the phone's own behaviour (the foreground service, the partial wake lock).
Wake lock. Taken with a safety timeout (so a bug can not hold the CPU for ever); a session may be longer than that, so the lock is renewed while the session runs.