-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Skip known-unreasonable network location updates #2367
base: master
Are you sure you want to change the base?
Conversation
|
Sounds good, thanks for all the info; happy to look into moving things around and following those suggestions. You had mentioned the fused location provider before, but I was having trouble identifying it; knowing that it's |
If we have a recent GPS location of a given accuracy, and our proposed network location is more than twice as far away as the GPS accuracy (but at least 1 kilometer away from the GPS location), this is considered unreasonable. Stop sending that network location. Change-Id: I1893c63c2d716a5e41011cbf39f069491e6b5da6
a079c9a
to
ced1af3
Compare
@t-m-w |
Is it the case that not all apps use the fused location provider? I've been trying to test this new branch with Android 14 and I don't see the log lines at all when using SatStat or Organic Maps. Added some extra ones locally and I don't see them either. It would be a shame for the network location to be this far off (thousands of miles, here) and have some apps never be able to recover from that. Then again, this change's only goal was to fix it once GPS is known, not permanently; it doesn't resolve the recurring annoyance when all you have is network location, so maybe it's not really a worthwhile approach...? |
Oh, yep, I've done it again... Thanks for pointing that out! |
Even if the improvement doesn't cover everything it is still a good improvement. An app can:
This is what I have understood. |
Any recommendations for an app that would take advantage of the approach in the current commits so that I can test it? |
FWIW, Organic Maps location jumps from Network to GPS occasionally (I guess). |
Apps that have their own location fusing logic (and I assume Organic Maps is one of them) are not affected by this change (and in fact can't really be fixed by us). The underlying problem is how to understand the accuracy information in a location reported. It is often simplified that the real location is in a circle with a radius of accuracy meters centered around the location given. This is not correct, the real location is only within this circle in 2 out of 3 cases (68th percentile). The remaining cases, it is outside this circle, and this is where the bigger problem is: With GPS, it is never more than a few hundred meters from the given location (no matter the accuracy given), du to how GPS works. With network-based location, as the database might have wrong data, it can be on the other side of the planet. Now location fusing is what combines network based location and gps based location to a single location, incorporating any metadata from each of the location sources. The basic implementation in AOSP has the simple logic of taking either GPS or network location, if one of them is 11s or more newer than the other, that one will be taken, if they're less than 11s from each other, the one with reported higher accuracy is taken. If apps take this implementation (by requesting fused location from AOSP based systems), they will likely see those jumps, same if they have their own, similarly naive implementations. We do need a much more sophisticated implementation if we want to compete with Google's service - which is what apps expect. Ignoring locations from the network provider that are implausible given the location information we have from GPS is a good start, but ultimately, we also want to logically merge the information where possible. |
I understand the idea that apps should be smart about how they fuse GPS and network location, if they choose to do it on their own, but in reality that doesn't seem to be the case, and such apps appear to work fine with reasonable network location providers but appear to be broken with microG. This is what makes me eager for a fix (or at least a workaround) in the network location provider, if the source of the provider's data is already known to be inaccurate in a large number of cases and with no solution on the horizon. At this rate, Mozilla Location Services will be shut down soon (some day in June I think - I don't remember the date off-hand), so we might be able to get away with postponing this without it making much of a difference. |
Can you provide examples of apps that behave peculiar bad with microG location (e.g. a lot of jumping between locations)? So we can better understand in how far this behavior differs in Google and why. If we just filter out locations from network location so that apps that do fuse can do this better, apps that don't fuse but only request network location won't get updates, which might be worse than giving them inaccurate updates. |
With the test steps below that aim to simulate a loss of GPS coverage, I haven't encountered an app that doesn't jump between locations after a short amount of time. (Copied from https://gitlab.com/CalyxOS/calyxos/-/issues/2257#note_1929698556 )
There are the apps I tried, this time:
|
If we have a GPS location of a given accuracy, and our proposed network location is more than twice as far away as the GPS accuracy, this is considered unreasonable. Stop sending that network location.
As part of this, also keep track of lower-accuracy GPS locations with accuracy as low as 10km.