# Automatic update device and network conditions

Library settings → **Automatic update conditions** configures all media types in
the current profile. Choose the existing download-network policy (the default),
Any connected network, Unmetered, or Wi-Fi only, and optionally require external
power. Manual library/group/single-title refresh remains available independently.
Wi-Fi and unmetered are distinct: paid Wi-Fi satisfies Wi-Fi only, whereas a
reported metered connection does not satisfy Unmetered.

**Check conditions** displays whether the selected restrictions are satisfied or
which reading/condition is missing. Policy changes cancel obsolete checks. Unknown,
denied or timed-out readings defer explicit restrictions; they never imply Wi-Fi,
free data or external power. Opening legacy defaults makes no new telemetry calls.
Readings are cached for up to five seconds across title-admission checks. Battery
APIs are only requested when power is required. Unrelated settings changes do not
reprobe, and an explicit check bypasses the cache.

For devices without network-cost reporting, **When network cost is unavailable**
lets the user keep waiting or explicitly classify the unknown connection as metered
or unmetered. This classification only fills an unknown cost. It cannot override a
reported metered connection, data-saver/low-data mode or a disconnected network.
There is no fabricated power or Wi-Fi reading and no implicit fallback for either.

The shared runner checks admission before refresh and the updater checks again
after waiting for its service lock and before each title request. Conditions changing
after a request has started are checked before the next title; this is not a promise
of instantaneous cancellation on every platform. Completed title writes remain
durable, unchecked-title error reports remain intact, and deferred work produces no
success notification. Foreground timers keep the schedule slot eligible for retry.
OS adapters retain retry eligibility rather than treating a deferral as completion.

## Platform integrations and concrete limits

- Android reads the active network's capabilities and the sticky battery/power
  broadcast. WorkManager gets library-specific charging/network constraints;
  metadata, sync and backup constraints retain their existing settings. Daily
  settings updates replace constraints without resetting the time anchor; changing
  the daily time still reanchors. Android 9+ can request a Wi-Fi transport directly;
  older versions also enforce Wi-Fi in shared admission. A condition deferral is
  separate from the ordinary three-failure retry limit.
- iOS reads a short-lived NWPathMonitor and UIDevice battery state. Path monitoring
  is cancelled and its callback cleared on completion, timeout or cancellation.
  Battery telemetry is process-wide. BGProcessingTaskRequest uses external-power
  admission, and deferred work is resubmitted with a 15-minute earliest retry.
  iOS still chooses actual execution time. Existing fixed OS identifiers belong
  to the Default profile; other profiles use their foreground timers while open.
- Desktop uses bounded read-only queries: macOS route/hardware-port/power output,
  Windows network-cost/connection-profile and power APIs through noninteractive
  PowerShell, and Linux default routes/sysfs/NetworkManager. Commands have runtime
  and output bounds and are terminated on caller cancellation. No credentials,
  network names or battery identifiers are stored or logged. Windows/Linux parser
  fixtures do not imply live verification on those operating systems.
- Browser uses available connection/online/battery APIs. Its battery promise has a
  bounded wait, denial remains unknown, and network-only checks never call it.
  The browser timer runs while the app is open; a closed page cannot run this work.

Browser telemetry is a real platform limit: Battery Status is unavailable in some
major browsers, and network transport/cost reporting is not universal. In those
cases external-power or Wi-Fi requirements stay deferred with a visible unavailable
reason. macOS cost reporting, unknown virtual/VPN transport, missing Linux tools and
unsupported desktop system APIs also retain unknown readings. The unknown-cost
classification handles cost explicitly; it does not claim missing hardware support.
These are documented capability limits, not successful hardware detection.

Preferences persist under device-local library feature settings. The gate and
status belong to the captured profile, and cancellation cannot publish a successful
late check into another profile. No source/provider HTTP probe discovers device state.

## Evidence and verification

Verification passed: 54 desktop checks, 71 Kotlin/Wasm browser tests and 3 Android
WorkManager unit checks, with no failures, errors or skipped tests. Desktop, Android,
iOS simulator ARM64 and web compiled. Tests exercise strict typed parsing, unknown/denied
readings, cache expiry/clock rollback, policy changes, cancellation, profile isolation,
service-lock admission, mid-run deferral, retained error reports and schedule retry.
Desktop command tests use real bounded processes; browser tests cross the actual
Kotlin/JavaScript boundary with isolated navigator fixtures, including a stalled
battery promise. Native power changes and OS job timing are not claimed as exercised.

Primary references:
[Android work constraints](https://developer.android.com/develop/background-work/background-tasks/persistent/getting-started/define-work),
[Wi-Fi NetworkRequest constraints](https://developer.android.com/reference/androidx/work/Constraints.Builder),
[Android power readings](https://developer.android.com/reference/android/os/BatteryManager),
[Apple background processing](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtaskrequest),
[Apple path interfaces](https://developer.apple.com/documentation/network/nw_path_uses_interface_type(_:_:)),
[Windows connection profiles](https://learn.microsoft.com/en-us/uwp/api/windows.networking.connectivity.connectionprofile),
[NetworkManager](https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/nmcli.html),
[Battery Status specification](https://www.w3.org/TR/battery-status/),
[browser compatibility overview](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API).
