Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevents infinite recursion when getting the location permission #1813

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

dkhawk
Copy link
Contributor

@dkhawk dkhawk commented Sep 19, 2024

The code was repeatedly requesting the access fine location permission in an infinite recursion loop which resulted in the app crashing. This removes the unnecessary call to request the permission in the updateLocationUI method.

@dkhawk dkhawk requested a review from wangela September 19, 2024 17:43
@@ -26,6 +26,8 @@
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.activity.result.ActivityResultLauncher;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need those imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Those were added when I looked into using the newer permission request flow, but that requires API 24

@dkhawk dkhawk requested a review from kikoso September 19, 2024 17:59
Copy link
Collaborator

@kikoso kikoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I was able to reproduce the issue on the previous code.

@dkhawk dkhawk merged commit 5790ff2 into main Sep 19, 2024
15 checks passed
@dkhawk dkhawk deleted the fix-infinite-permission-loop branch September 19, 2024 18:21
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