Repository navigation
fix: ask for notifications and local network access in one request - #1146
Merged
eddyizm merged 1 commit intoOct 3, 2026
Merged
Conversation
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.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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.
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.
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.