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
googlemaps-bot pushed a commit that referenced this pull request Jan 14, 2025
# [1.14.0](v1.13.0...v1.14.0) (2025-01-14)

### Bug Fixes

* add dynamic key values to secrets.properties in idx template ([#1814](#1814)) ([46abfae](46abfae))
* always use secrets.properties for storing the API keys ([#1812](#1812)) ([561e829](561e829))
* Exports sample activities so they can be run directly ([#1808](#1808)) ([206cdcf](206cdcf))
* fixed release config ([#1944](#1944)) ([6b62127](6b62127))
* fixed release step ([#1770](#1770)) ([cb53eb4](cb53eb4))
* fixed secrets in wearable module ([#1788](#1788)) ([5ea1951](5ea1951))
* import rememberMarkerState and use the marker state correctly ([#1787](#1787)) ([5095437](5095437))
* prevents infinite recursion when getting the location permission ([#1813](#1813)) ([5790ff2](5790ff2))
* Re-add MarkerDemoActivity in Kotlin sample ([#1916](#1916)) ([66db0fa](66db0fa))
* stop memory leak in CoordTileProvider ([#1929](#1929)) ([55c6297](55c6297))
* Update emulator host in dev.nix for IDX ([#1893](#1893)) ([26e5bd3](26e5bd3))
* Updates secrets in app-level build.gradle.kts files to set secrets.properties as propertiesFileName. ([#1785](#1785)) ([dcec2ce](dcec2ce))
* using rememberMarkerState instead of MarkerState ([#1768](#1768)) ([6007cc8](6007cc8))

### Features

* Introduces an idx folder containing an IDX template, enabling users to open Android tutorials directly in the IDX IDE. ([#1757](#1757)) ([b32a515](b32a515))
* tooling modernization ([#1753](#1753)) ([42f3887](42f3887))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 1.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants