Repository navigation
feat: target Android 17 and ask for local network access - #6977
Open
AndyScherzinger wants to merge 3 commits into
Open
AndyScherzinger wants to merge 3 commits into
AndyScherzinger wants to merge 3 commits into
Conversation
Contributor
📱 QA build
The QA build installs alongside a released Nextcloud app, so you can keep Downloading the file requires a GitHub account, so open this link on the |
AndyScherzinger
force-pushed
the
feat/target-sdk-37
branch
2 times, most recently
from
October 29, 2026 07:17
4bb0c96 to
07697ce
Compare
Apps targeting API 37 need ACCESS_LOCAL_NETWORK to reach the local network. Without it, a request to a server on the LAN never reaches it and times out after 45 s with no hint about a permission. Ask for it where it matters, and only on Android 17 and later: - on server selection, and for a scanned login QR code, when the server is a .local name or resolves to a private, link-local, CGNAT or unique local address - when the conversation list opens, for the current account, so existing accounts and servers that only resolve locally at home are covered too - on the first call, so peers on the same network can connect directly; calls still work through TURN without it, so a denial is not asked again When the permission is denied, a dialog explains why it's needed and offers to ask again, or to open the app settings once the system no longer shows its prompt. While the app targets API 36 the permission is granted implicitly through INTERNET, so nothing is asked before the targetSdk bump. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <[email protected]>
Verified on an Android 17 emulator with generic and gplay builds: local network access, voice messages and calls in the background, picture-in-picture, incoming calls on the lock screen and from the heads-up notification, push delivery, contact sync, Certificate Transparency against a public server, and the Robolectric tests on SDK 37. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <[email protected]>
Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <[email protected]>
AndyScherzinger
force-pushed
the
feat/target-sdk-37
branch
from
October 30, 2026 08:44
07697ce to
33e7a54
Compare
Contributor
AndyScherzinger
marked this pull request as ready for review
October 30, 2026 14:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raises
targetSdkfrom 36 to 37 (lintOldTargetApi, 14 → 13) and adds what Android 17 needs for that: the local network permission. Without it, a server on the LAN is unreachable: requests time out after 45 s with no hint about a permission (verified on an Android 17 emulator).📡 Local network permission (
ACCESS_LOCAL_NETWORK)Asked only on Android 17+, and only where it matters:
.localname or resolves to a private, link-local, CGNAT or unique local address. The resolved address is checked, not just the URL, so LAN host names are covered.When it's denied, a dialog explains why it's needed and offers to ask again, or to open the app settings once the system no longer shows its prompt (after two denials). Dismissing it on server selection shows an error instead of running into the timeout. Chrome asks for its own Nearby devices permission during browser login for a LAN server; there's deliberately no warning for that for now.
Verified on the Android 17 emulator (gplay build of this branch,
RESTRICT_LOCAL_NETWORKenforced, server on10.0.2.2):run-as, app in the foreground) to10.0.2.2:8081times out after 8 s with the permission revoked and returns200 OKwith it granted. A request to the public1.1.1.1:80succeeds either way.cloud.nextcloud.com) and the permission denied: no prompt, browser login opens.ServerSelectionActivity.serverFromQr, unit-tested for both QR formats (nc://login/,nc://onetime-login/) and any element order, and then goes through the same check as a typed URL.🔍 Rest of the Android 17 changes
Checked against the codebase and on an Android 17 emulator (API 37, generic and gplay builds at target 37); no code change needed:
ContactsContractcolumn removal: contact sync still finds and updates linked contacts.🖼️ Screenshots
🚧 TODO
connectedAndroidTeston an API 37 emulator (gplay debug, 51 tests passed;LoginITandShareUtilsITare@Ignored in the code)🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)