Skip to content

Ask for Android 17 local network access before connecting to a LAN server - #39

Merged
Tarquinen merged 1 commit into
devfrom
fix/local-network-permission
Nov 11, 2026
Merged

Tarquinen merged 1 commit into
devfrom
fix/local-network-permission

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes anomalyco/opencode#62934.

On Android 17, apps targeting SDK 37 need ACCESS_LOCAL_NETWORK (Nearby devices) to reach the local network. The app never declared it, so connecting to or pairing with a LAN server timed out.

Now connecting or pairing to a local network server shows the system dialog first. If access is off, the error says why and offers Open Settings, and Home's Try Again asks again or opens Settings. Below SDK 37 nothing changes.

  • API 37 emulator against session-lab: Allow connects, and Don't allow shows the copy with Open Settings. Allowing there then connects, from both the connect screen and Home.
  • Pairing via a deep link shows the dialog, and a denial shows "Couldn’t Pair" with the same copy.
  • API 36: no dialog, connects as before.

Not tested: pairing then Allow (session-lab has no /auth/connect); it shares the normal connect path.

…rver

Android 17 blocks apps targeting SDK 37 from the local network until they
hold ACCESS_LOCAL_NETWORK (Nearby devices). The app never declared it, so
every LAN connect or pairing silently timed out (anomalyco/opencode#62934).

Now the permission is declared, and connecting or pairing to a server the
existing route classifier calls Local Network asks first, the way iOS shows
its own prompt on the first LAN connection. A failure while access is off
says why, with Open Settings, instead of the bare timeout. Home's Try Again
asks again, else opens Settings. Below SDK 37 nothing changes.

Verified: vm.sh check :server :feature:drawer :app. On an API 37 emulator
against session-lab at 10.0.2.2: first connect shows the dialog and Allow
connects; Don't allow shows the copy with Open Settings, which opens App
info; allowing there and connecting again works; pairing via a deep link
shows the dialog and a denial shows the copy; a restored Home after a
revoke asks on Try Again (or opens Settings when Android won't ask) and
reconnects once allowed. On an API 36 slot: no dialog, connects as before.
@Tarquinen
Tarquinen force-pushed the fix/local-network-permission branch from 9d41489 to 16962e9 Compare November 11, 2026 23:12
@Tarquinen Tarquinen changed the title Ask for Android 17's local network permission and fail fast without it Ask for Android 17 local network access before connecting to a LAN server Nov 11, 2026
@Tarquinen
Tarquinen merged commit 6161531 into dev Nov 11, 2026
1 check passed
Tarquinen added a commit that referenced this pull request Nov 11, 2026
…on) into feat/assistant

Only docs/parity/app.md conflicted: the assistant row and #39's local network row were both new, so both stay. MainActivity merged cleanly, with #39's permission launcher next to the assistant's code.
@Tarquinen Tarquinen mentioned this pull request Nov 12, 2026

This branch was previously deployed

1 inactive deployment
release — 16962e98 Deployed Nov 11, 2026 by Tarquinen via check #120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant