Skip to content

Fix local network access on Android 17 - #97

Open
Hunter-The-Furry wants to merge 1 commit into
Imnotndesh:mainfrom
Hunter-The-Furry:fix/android-17-local-network-permission
Open

Fix local network access on Android 17#97
Hunter-The-Furry wants to merge 1 commit into
Imnotndesh:mainfrom
Hunter-The-Furry:fix/android-17-local-network-permission

Conversation

@Hunter-The-Furry

Copy link
Copy Markdown

What changed

Android 17 requires apps targeting SDK 37 to request local network access before connecting to devices on the LAN.

This adds the ACCESS_LOCAL_NETWORK permission and requests it at startup on Android 17+. Older Android versions keep the existing behavior.

Why

Without the permission, connections to a local TrueNAS server can just time out even though the server is reachable from the browser.

This may also be the cause of #96 if that GrapheneOS device is up to date and running Android 17, since the reported symptoms are very similar.

Tested

Built and installed the GitHub debug APK on a physical Android 17 device and confirmed I can connect and log in to a local TrueNAS instance after granting the Local Network permission.

testGithubDebugUnitTest and assembleGithubDebug pass.

lintGithubDebug still fails on 3 existing UnusedMaterial3ScaffoldPaddingParameter errors in unrelated files. This change does not add any new lint warnings.

@Hunter-The-Furry

Copy link
Copy Markdown
Author

A few follow-up ideas I left out of this PR so it stays focused:

  • The notification and local-network permission prompts can both happen during startup right now. It may be worth handling those in sequence so they don't compete with each other.
  • If Local Network permission is denied, the app still starts, but local instances will just fail to connect. A more specific message there, with a shortcut to app settings, would probably be nicer.
  • It might also make sense to only ask for Local Network access when a local instance actually needs it. Saved instances that reconnect on startup make that a bit more involved, though.

I left these out since they felt more like follow-up UX work than part of the actual connection fix.

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