-
Notifications
You must be signed in to change notification settings - Fork 26
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: location sharing without gms when not moving [WPB-9724] 🍒 🍒 #3145
fix: location sharing without gms when not moving [WPB-9724] 🍒 🍒 #3145
Conversation
app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/location/GeocoderHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/location/LocationPickerHelper.kt
Outdated
Show resolved
Hide resolved
Built wire-android-staging-release-pr-3145.apk is available for download |
Built wire-android-dev-debug-pr-3145.apk is available for download |
Built wire-android-staging-compat-pr-3145.apk is available for download |
Built wire-android-dev-debug-pr-3145.apk is available for download |
Quality Gate passedIssues Measures |
Built wire-android-staging-compat-pr-3145.apk is available for download |
Built wire-android-dev-debug-pr-3145.apk is available for download |
This PR was automatically cherry-picked based on the following PR:
Original PR description:
This PR was automatically cherry-picked based on the following PR:
Original PR description:
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Sometimes when we want to share the location on grapehene devices, the app is stuck on loading.
Causes (Optional)
On graphene there is no google services so the app uses the native manager to get the location, by requesting location updates. It works fine when the user is moving, but not when standing in the same place, probably because
requestLocationUpdates
emits items only when the location changes.Solutions
On newer Android versions use new way of getting location -
getCurrentLocation
and on old ones instead ofrequestLocationUpdates
, userequestSingleUpdate
because the app needs and uses only a single data anyway, doesn't need to listen for multiple changes.Also, to make it even faster and more user friendly, first the last known location is checked and if it's not too old (currently if it's not older than 1m) then just use this last location because it looks like the user hasn't moved since then.
If the last location is too old, then just request the current one. There is also a timeout of 10s to get the current location,
getCurrentLocation
has some timeout anyway, but it's not configurable and it's unclear how big it is, so to make it unified a custom one is created - if the new location doesn't appear within 10s, then user gets the info that the app couldn't get the location.Added tests for both
LocationPickerHelper
(to test getting location without google services on both new and old Android versions using robolectric) andLocationPickerHelperFlavor
(to test getting location with google services using mockk).Testing
Test Coverage (Optional)
How to Test
Open conversation screen and try to share location.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.