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

Use the same location providers in every map engine + some tweaks #5636

Merged
merged 6 commits into from
Jul 7, 2023

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jun 19, 2023

Closes #5633

What has been done to verify that this works as intended?

I've tested manually the map engines we support.

Why is this the best possible solution? Were any other approaches considered?

The fix itself is in the first commit Use the same location providers in all map engines
. As discussed on slack the problem was that mapbox used its own location engine but google and osm our own providers. As a result, the mapbox engine messed up somehow with our providers (internally). Now all map engines use the same mechanism to retrieve the location and thanks to that mapbox works well and the behavior is consistent.

Other commits are just some improvements that I've identified:

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

It should solve the problem with switching map engines and also make the behavior across different engines consistent. There is no one particular area of risk but it ould be more about recording locations than drawing lines/shapes/points for example.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review June 20, 2023 08:03
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

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

So many good changes here! I want to discuss the included analytics, but nothing should block this from going to QA.

@@ -196,6 +198,7 @@ public void onConnectionSuspended(int cause) {

@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Analytics.log("GoogleFusedLocationClient", "onConnectionFailed", connectionResult.toString());
Copy link
Member

Choose a reason for hiding this comment

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

We'd need to add onConnectionFailed as a custom dimension to events in Firebase for this. I'm also a little worried about logging the connectionResult in case it contains a device identifier (or anything that could be PII).

Instead, could we just log a simple event like GoogleFustLocationClientConnectionFailed? That said, is this even something we have a question about? I'm not sure we're looking to track this at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm also a little worried about logging the connectionResult in case it contains a device identifier

Instead, could we just log a simple event like GoogleFustLocationClientConnectionFailed? That said, is this even something we have a question about?

I wanted to know not only how often it happens but if the result contains something important to display to a user.

Copy link
Member Author

Choose a reason for hiding this comment

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

but I don't have strong feelings about it so I'm ok with just checking if this takes place at all and then deciding if we need to determine the reason or just display something.

@srujner
Copy link

srujner commented Jul 7, 2023

Tested with Success!

Verified on device with Android 13

Verified cases:

@dbemke
Copy link

dbemke commented Jul 7, 2023

Tested with Success!

Verified on device with Android 10

@grzesiek2010 grzesiek2010 requested a review from seadowg July 7, 2023 12:19
@seadowg seadowg merged commit 01d9fc7 into getodk:master Jul 7, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maps unable to set location/ loading takes too much time after switching from Mapbox
4 participants