Skip to content

fix(Android): support local network access on Android 16+ - #1083

Open
aviadlevy wants to merge 1 commit into
DonutWare:developfrom
aviadlevy:fix/android-local-network-access
Open

fix(Android): support local network access on Android 16+#1083
aviadlevy wants to merge 1 commit into
DonutWare:developfrom
aviadlevy:fix/android-local-network-access

Conversation

@aviadlevy

Copy link
Copy Markdown
Contributor

Pull Request Description

Adds support for Android 16's Local Network Protection, which requires apps to explicitly declare and request the ACCESS_LOCAL_NETWORK permission before they can talk to devices on the local network. Fladder never declared it, so on Android 16+ the system quietly blocked every connection to a Jellyfin server on the user's own network.

Changes:

  • Declares android.permission.ACCESS_LOCAL_NETWORK in the manifest. Older Android versions don't know the permission and ignore it, so nothing changes there.
  • Requests it where it's needed — when a local URL is saved in settings, and on startup when one is already configured (existing users would otherwise never be prompted, since they never re-save their URL).
  • Handles denial. Android only prompts once, so after a denial there is no way back from inside the app. The profile settings page now shows a warning that opens Fladder's system settings page and re-checks the permission on resume — the same pattern the page already uses for battery optimization.
  • Makes the local server probe more robust. It's re-run once access is granted, rather than latching on the result of a probe that ran while traffic was still blocked, and its timeout goes from 1s to 3s, which a cold Wi-Fi handshake can exceed.

The platform side is a small Pigeon host API (pigeons/local_network_access.dart), matching the existing battery_optimization setup.

AI assistance

Root-cause investigation and the patch were done with Claude Code; diagnosis, fix design, and on-device validation were human-reviewed and -owned.

Issue Being Fixed

On Android 16+ devices, Fladder cannot reach a Jellyfin server on the local network. The "Local Jellyfin URL" indicator stays red and the app reports Offline, even though the server is reachable from every other device and browser on the same LAN.

Tested On

  • Android
  • Android TV
  • iOS
  • Linux
  • Windows
  • macOS
  • Web

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

Android 16 gates access to local network addresses behind the
ACCESS_LOCAL_NETWORK runtime permission for apps targeting SDK 36+.
Fladder never declared it, so the platform silently dropped every
connection to a Jellyfin server on the user's own network. Nothing was
logged and no error surfaced; the request simply went nowhere and timed
out. The local URL indicator stayed red and the app fell back to the
remote URL, reporting Offline even though the server was reachable from
any browser on the same network.

Declare the permission and request it where it is needed: when a local
URL is saved, and on startup when one is already configured. Android
only prompts once, so after a denial the profile settings page shows a
warning that opens the app's system settings page and re-checks the
permission on resume.

Also make the local server probe tolerate a slow first connection. It is
re-run once access is granted instead of latching on the result of a
probe that ran while traffic was still blocked, and its timeout is raised
from 1s to 3s, which a cold Wi-Fi handshake can exceed.
@aviadlevy
aviadlevy force-pushed the fix/android-local-network-access branch from 8a3bcd2 to 370c2af Compare August 10, 2026 10:31
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