fix: prevents infinite recursion when getting the location permission by dkhawk · Pull Request #1813 · googlemaps-samples/android-samples
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.
| import android.widget.FrameLayout; | ||
| import android.widget.TextView; | ||
|
|
||
| import androidx.activity.result.ActivityResultLauncher; |
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?
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
kikoso
left a comment
•
Loading
kikoso
left a comment
•
Loading
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
deleted the
fix-infinite-permission-loop
branch
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