Skip to content

fix: ask for notifications and local network access in one request - #1146

Merged
eddyizm merged 1 commit into
eddyizm:developmentfrom
herrerad85:fix/local-network-permission-request
Oct 3, 2026
Merged

eddyizm merged 1 commit into
eddyizm:developmentfrom
herrerad85:fix/local-network-permission-request

Conversation

@herrerad85

Copy link
Copy Markdown
Contributor

Part of #1144.

On Android 17 the app asks for notifications and then straight away for local network access. Android refuses a second request while the first is still open, so whenever notifications are not granted the local network prompt never appears, and every connection to a server at a local address fails. This asks for both in one request. It is a stopgap until the permission screen in the login flow exists.

checkPermission called ActivityCompat.requestPermissions for
POST_NOTIFICATIONS and then again for ACCESS_LOCAL_NETWORK. While a
request is still open, Activity.requestPermissions refuses another one,
logs "Can request only one set of permissions at a time" and returns an
empty result. The two calls run back to back in onCreate, so the second
was refused every time the first one ran, which is every launch where
notifications are not granted, permanently denied included. On Android
17 those users were never asked for local network access, and every
connection to a server on their network failed.

Collect the missing permissions and request them in one call.

Tested on an Android 17 emulator against a Navidrome server over HTTP.
With both permissions unasked, the old build logs the warning and shows
only the notifications prompt; this build shows both. With
notifications permanently denied, the old build shows no prompt at all;
this build shows the Nearby devices prompt. Once local network access
is allowed, the library loads on the next launch with notifications
allowed or denied.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8cdeb5f1-ffe2-42a4-bd4e-6658a948936c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@eddyizm
eddyizm merged commit 8ae8c93 into eddyizm:development Oct 3, 2026
2 checks passed
@herrerad85
herrerad85 deleted the fix/local-network-permission-request branch October 4, 2026 03:43
eddyizm pushed a commit that referenced this pull request Oct 5, 2026
…#1159)

On Android 17 the startup ping runs while the local network prompt is
still open, the connection is held, and the app reports the server
unreachable. The ping now waits for the answer, and the saved queue
waits with it. A permanent denial is answered with no prompt after
onResume, so the permission result pings too. A waiting restore stops
once its service is destroyed.

Follow up to #1146. Every line this changes came in with #1146 or #1098.
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.

2 participants