Only RTN_THROW continues routing onto the physical LAN. RTN_UNICAST and RTN_UNREACHABLE do not, including for .local names and IPv6-only unreachable routes. Regression tests failed against the previous predicate and now pass.
Remove the automatic root prompt, network observer, denial cache, custom rationale, and source-specific sync retry state. Test and Save now validate first and launch the system Nearby devices request only when the entered destination needs it; an existing server can be recovered through Edit Server.
Keep the precise on-link check: resolve before reading the current networks, exclude cellular and VPN-routed destinations, honor longest-prefix VPN exclusions, and handle .local without attempting blocked mDNS resolution. Consolidate coverage into the SDK 37 Robolectric suite and delete the gate state-machine tests with the state machine.
Extract the on-link decision into a pure function, test it with the
Android 17 SDK through Robolectric's connectivity shadows, and exercise
the gate's grant, denial, cancellation and stale-check paths with a fake
checker. The SDK 37 shadow needs jdk.internal.access exported to the
test JVM.
Read link addresses after resolution so a network change during DNS
cannot authorize the wrong interface, require the persisted offline
state before the form acts, skip on-link prompting for destinations the
active VPN routes, and retry a raced sync only for the source the prompt
belongs to.
Remember the gate across recompositions so cancel() reaches the running
check, rethrow cancellation instead of reading it as permission-not-
needed, and abandon a form action when the address changed under it.
Only retry a sync that was running or failed after the prompt, and wait
for the persisted offline state before checking the network.
Generation-scope the on-link check so a network, source or offline change
invalidates the result and drops an unanswered rationale. Mark the form
busy while the gate resolves so a second tap cannot run a duplicate save,
and require an eligible interface before treating .local as local. Fold
the repeated denial and network-change handlers into helpers.
Record an explicit denial rather than the presentation, so an unanswered
prompt is shown again after recreation. Watch every network instead of
only the default, exclude VPN and cellular interfaces from the on-link
set, skip the gate while offline, and only retry a sync the prompt
actually raced.
Treat .local names as gated before resolving, because resolution is the
operation the missing permission blocks. Gather link addresses from every
network so a split-tunnel VPN that falls through to the LAN still
prompts, and re-run the root check when the default network changes.
Retry the sync after a prompt is granted, and remember addresses that
already showed the rationale so the automatic check does not nag after
the form declined. Use IpPrefix instead of a hand-written matcher.
Android 17 blocks apps targeting API 37 from reaching directly connected
addresses without ACCESS_LOCAL_NETWORK, and a blocked TCP connect is
indistinguishable from a dead server. Resolve the configured host, check
it against the active network's link addresses, and ask for the
permission only when the server is actually on-link, so routed RFC1918
and VPN destinations do not trigger a prompt.
Refresh per-source rows under the reconciliation mutex before reset decisions and chunk queue-visibility checks to respect SQLite bind limits.
Cover a blocked pre-completion emission and source deletion at the bundled SQLite variable limit.
Consume captured reset points on the first collector emission and leave pending sources uninitialized during reconciliation.
Build ordered baselines from queue-visible completed downloads and ignore pruned-row transitions while retaining all-row state and recovery.
Prepare queue and playback reconciliation inside the reset transaction without publishing listener, cache, or revision state. Publish through a non-suspending, non-cancellable post-commit step so committed resets are never retried over later edits.
Keep the pending-origin clear under the cursor lock without a redundant single-statement transaction, and cover listener and post-clear write failures.
Move pending-origin clearing into the queue mutation lock, acquire the cursor lock before Room, and clear pending rows before cache, revision, or listener side effects. Keep sync listener reconciliation transactional for retries while preserving direct reset commit visibility.
Run transition bookkeeping under the queue mutation lock, retain detached playback when its final survivor is removed, and restore offline repeat wrapping without a forward survivor. Centralize detached survivor rebuilding and add regressions for each defect.