Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork925
Fix locationAlways does not work on Android 10#921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
hirameee55 commentedSep 27, 2022
@mvanbeusekom |
| if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.R) | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Reading through thedocumentation, I think we should always fall through to the location case and add theACCESS_COARSE_LOCATION and/ orACCESS_FINE_LOCATION as well. Meaning we need to remove thebreak; statement al together.
We should also improve the comment above to reflect this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi@mvanbeusekom
Thank you for your review.
If remove thebreak;,#794 doesn't work.
Android R (11) and above cannot request background and foreground permissions at the same time.
Therefore, for Android R (11) and above, it is ideal to break ifManifest.permission.ACCESS_BACKGROUND_LOCATION is included and acquire permissions only in the background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi@mvanbeusekom
Could you confirm my comments?
Please feel free to contact us if you have any questions.
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
This change fixes the regression described in Issue#917.
The current behavior is that Runtime Permission is not shown when requesting locationAlways on Android 10 (Q).
🆕 What is the new behavior (if this is a feature change)?
In Android Q (10), it is possible to request background and foreground permissions at the same time. LocationAlways satisfies this.
Android 11 (R) or higher cannot request background and foreground permissions at the same time, so v10.0.1 behavior is not affected.
These are Android specifications.
https://developer.android.com/training/location/permissions#request-background-location
💥 Does this PR introduce a breaking change?
No.
🐛 Recommendations for testing
When I request locationAlways on Android 10 (Q), the Runtime Permission appears and I can select "Allow all the time".
📝 Links to relevant issues/docs
🤔 Checklist before submitting
master.