YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.client.LockPolicy Class Reference

Which locks the service takes and when it renews them. More...

Collaboration diagram for de.yaacc.snapcast.client.LockPolicy:
Collaboration graph

Static Public Member Functions

static int wifiMode (int sdkInt)
 
static boolean wifiLockWorksWithScreenOff (int sdkInt)
 False when the Wi-Fi lock of this version is not active with the screen off.
 
static boolean shouldRenewWakeLock (long nowMillis, long lastRenewMillis)
 

Static Public Attributes

static final int WIFI_MODE_FULL_HIGH_PERF = 3
 The values of WifiManager.WIFI_MODE_FULL_HIGH_PERF and WIFI_MODE_FULL_LOW_LATENCY.
 
static final int WIFI_MODE_FULL_LOW_LATENCY = 4
 
static final long WAKE_LOCK_SAFETY_TIMEOUT_MS = 8L * 60 * 60 * 1000
 
static final long WAKE_LOCK_RENEW_INTERVAL_MS = 30L * 60 * 1000
 

Detailed Description

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.


The documentation for this class was generated from the following file: