Declare ACCESS_LOCAL_NETWORK permission so local homeservers work on Android 17#7164
Closed
mallafix wants to merge 1 commit into
Closed
Declare ACCESS_LOCAL_NETWORK permission so local homeservers work on Android 17#7164mallafix wants to merge 1 commit into
mallafix wants to merge 1 commit into
Conversation
…oid 17 Since the targetSdk was raised to 37, Android enforces the new local network protections. Without declaring ACCESS_LOCAL_NETWORK the system silently drops all traffic to homeservers on private addresses and users cannot even grant the permission manually (no toggle is shown). Declaring the permission makes the 'Nearby devices' toggle available so affected users can allow local network access. Fixes element-hq#7073 Signed-off-by: mallafix <mallafix@mhoz.de>
|
|
Contributor
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
bxdxnn
suggested changes
Jul 7, 2026
bxdxnn
left a comment
Contributor
There was a problem hiding this comment.
We need to ask for this permission too if the user changes or already changed his server to a local one.
Contributor
|
Anyway, this PR should be closed as there's an Element-submitted one there: #7165 |
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.
Content
Declare the
ACCESS_LOCAL_NETWORKpermission in the matrix api library manifest (next toINTERNET).Motivation and context
Since the targetSdk was raised to 37, Android 17's local network protections are enforced. Element X currently does not declare
ACCESS_LOCAL_NETWORK, so:appopsrejects mode changes.Declaring the permission makes the "Nearby devices" permission toggle available in the app settings, which is the minimal fix suggested in the discussion of #7077 ("devs can just add the permission to the manifest"). A follow-up could request the permission at runtime during server selection, as attempted in #7077, but this one-liner already unblocks affected self-hosters.
Fixes #7073
Tests
appops get ... ACCESS_LOCAL_NETWORKshowing a freshrejectTimeon every app start), no permission toggle available.Checklist