Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
hirameee55 wants to merge1 commit intoBaseflow:main
base:main
Choose a base branch
Loading
fromhirameee55:issue/917

Conversation

@hirameee55
Copy link

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

This change fixes the regression described in Issue#917.

⤵️ What is the current behavior?

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

  • I made sure all projects build.
  • I updated pubspec.yaml with an appropriate new version according to thepub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I followed the style guide lines (code style guide).
  • I updated the relevant documentation.
  • I rebased onto currentmaster.

@hirameee55
Copy link
Author

@mvanbeusekom
I need the approval of the maintainer to have it reviewed.

Comment on lines +120 to +122

if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.R)
break;
Copy link
Member

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.

Copy link
Author

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.

Copy link
Author

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mvanbeusekommvanbeusekommvanbeusekom requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@hirameee55@mvanbeusekom

[8]ページ先頭

©2009-2025 Movatter.jp