-
Notifications
You must be signed in to change notification settings - Fork 371
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: Catch IllegalStateException on call to Google's location library #1940
Merged
jennantilla
merged 2 commits into
user-model/main
from
fix/catch_exception_for_location_lib
Dec 15, 2023
Merged
Fix: Catch IllegalStateException on call to Google's location library #1940
jennantilla
merged 2 commits into
user-model/main
from
fix/catch_exception_for_location_lib
Dec 15, 2023
Conversation
This file contains 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
Catch IllegalStateException and log them to avoid crashes on calls to Google's location library
jennantilla
requested review from
jkasten2,
nan-li,
emawby,
jinliu9508 and
shepherd-l
December 13, 2023 21:02
jkasten2
approved these changes
Dec 13, 2023
Are there other reports of I think it may be clearer to check for fun getLastLocation(googleApiClient: GoogleApiClient): Location? {
if (googleApiClient.isConnected) {
return LocationServices.FusedLocationApi.getLastLocation(googleApiClient)
}
return null
} private fun refreshRequest() {
if (!googleApiClient.isConnected) {
Logging.warn("Attempt to refresh location request but not currently connected!")
return
}
// ... stuff |
jennantilla
force-pushed
the
fix/catch_exception_for_location_lib
branch
from
December 14, 2023 22:48
202e0f9
to
d690988
Compare
…instead of try/catch
jennantilla
force-pushed
the
fix/catch_exception_for_location_lib
branch
from
December 14, 2023 22:49
d690988
to
85689d8
Compare
jkasten2
approved these changes
Dec 14, 2023
nan-li
approved these changes
Dec 15, 2023
Merged
jinliu9508
pushed a commit
that referenced
this pull request
Jan 31, 2024
…ion_lib Fix: Catch IllegalStateException on call to Google's location library
jinliu9508
pushed a commit
that referenced
this pull request
Jan 31, 2024
…ion_lib Fix: Catch IllegalStateException on call to Google's location library
jinliu9508
pushed a commit
that referenced
this pull request
Feb 6, 2024
…ion_lib Fix: Catch IllegalStateException on call to Google's location library
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Catch IllegalStateException on call to Google's location library to avoid crash.
Details
Motivation
IllegalStateException was reported in #1821, potentially due to and issue with a device's "Google Play services" app. Catching these exceptions and logging them will avoid crashes on calls to Google's location library.
OPTIONAL - Other
While the original crash was not reproducible, adding this try/catch block to log the exception should prevent the app from crashing.
Manual testing
Since crash was not reproducible, just tested running app to ensure that change does not impact location sharing on Android.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is