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

Position frozen at some offset at a place I haven't been (while OsmAnd running concurrently has no problem) #5807

Open
sjvudp opened this issue Aug 17, 2024 · 9 comments
Labels
bug feedback required more info is needed, issue will be likely closed if it is not provided

Comments

@sjvudp
Copy link

sjvudp commented Aug 17, 2024

First time seen, version is v58.2 running on Android 13:
Today I wanted to add some nearby information, so I loaded the corresponding data and walked out.
However soon I noticed that the position indicator was not where I was, so I guessed the GPS did not sync yet.
In such cases I always open GPStest in satellite view, but it showed that there were more than 15 satellites being used for the position fix, so I guessed it cannot be that wrong.
Next I started OsmAnd, just to find that it had the correct position.
Next I swiped SC off the task list, restarting it.
Still the position was off, and even when walking, that position did not move.
At that point I saved the logs to a draft mail message (that I could send on request).

How to Reproduce

Goof question; no idea (other than the description above)

Expected Behavior

The position indicator should indicate the current position, not worse than what GPS delivers.

Versions affected

Adroid 13 (Oppo ColorOS), SC v58.2

@sjvudp sjvudp added the bug label Aug 17, 2024
@sjvudp
Copy link
Author

sjvudp commented Aug 17, 2024

Checking the app's permission in Android's app management, I saw that it did not have permission for location!
(My guess is that I didn't use the app for a while, and Android's "security feature" did remove all app permissions, and I did not remember to re-assign those)
However this brings up a real bug:
It seems the permission checking is not done correctly: Maybe the app remembers a flag that show that one it had permission to the the location, but current Android can revoke permissions, too.
So I guess the check for permissions should be reviewed under current Android development guidelines.

Maybe "Don't assume that these permissions have been previously granted—check them and, if needed, request them before each access." in https://developer.android.com/guide/topics/permissions/overview?hl=en

And I think that it's better not to show a position indicator at all, rather than showing one at the wrong location, especially as SC re-positions to that location frequently.

@westnordost
Copy link
Member

westnordost commented Aug 17, 2024

I cannot reproduce this by going to the settings and change the app's location permission to "denied".
When I reopen the app, it shows the location not available.

@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label Aug 17, 2024
@sjvudp
Copy link
Author

sjvudp commented Aug 18, 2024

I cannot reproduce this by going to the settings and change the app's location permission to "denied". When I reopen the app, it shows the location not available.

Can I send the logs I saved via E-Mail to you? Maybe they help.

@mnalis
Copy link
Member

mnalis commented Aug 18, 2024

Regarding the initial issue (OsmAnd showing correct location, and SC not) I've had this issue with StreetComplete too when GPS signal was interrupted (i.e. I entered a supermarket and exited some time later).

SC would look like it had a fix, and direction indication would rotate as I did, but lat/lon would be wrong (showing last location where I was while I was still in SC, while OsmAnd would show actual location where I exited the shop. It seemed like SC didn't update the location when fix was re-acquired, while OsmAnd did).

Also, while it was improved, it was not possible to fix it completely, so it is still not visually as clear to see that GPS is not returning current location as it is in other apps

(If it happens again once MapLibre release is out, I'll try to report it...)


@sjvudp did you perhaps take a screenshot or video? Was the GPS indicator in lower-right corner of the screen steady, blinking, or stricken-out? Did you perhaps tried clicking it (and what happened if you did)?

As for the removed permission, SC seems to show stricken-out GPS button for me in such case, and I have to press it to get a warning dialog to re-enable the GPS.

@westnordost
Copy link
Member

Can I send the logs I saved via E-Mail to you? Maybe they help.

No, because nothing to this effect is logged.

@sjvudp
Copy link
Author

sjvudp commented Aug 18, 2024

Not sure whether I should name it "reproduced", but it happened again to me today. Before I had enabled "GPS" checked in SC that the position was current (it was). Then I disabled "GPS", went outside, wanted to check some spot, so I re-enabled "GPS", just to find that the position is still the old one. Again I saved the logs, and made a short video of the issue. Taping on the position indicator just caused some zoom-in, but did not fix the effect. I have the impression that the effect is new in this version of SC.

Record_2024-08-18-18-16-55-1-H.264.webm

The only thing found in logcat was this:

[08-18 18:17:31.451 1868:1968 E/OplusThermalStats]
Error getting package info: de.westnordost.streetcomplete

and some messages related to Android Auto (I guess; not connected to a car at that moment, however):

[08-18 18:17:30.869 3194:15113 W/ContextImpl]
Calling a method in the system process without a qualified user: android.app.ContextImpl.startActivity:1095 android.app.ContextImpl.startActivity:1084 android.content.ContextWrapper.startActivity:442 com.oplus.appplatform.providers.ContextProvider.startActivity:3 java.lang.reflect.Method.invoke:-2

In the app logs I found nothing related to the issue.

@westnordost
Copy link
Member

Hm well, the code that is used to get the current location is here:

https://github.com/streetcomplete/StreetComplete/blob/a6c49bc4a845d002e174d3ab1910cbc07e6850e9/app/src/main/java/de/westnordost/streetcomplete/util/location/FineLocationManager.kt

The app may consider an older GPS location "better" than a more current one that is (much) less precise.

@mnalis
Copy link
Member

mnalis commented Aug 19, 2024

The app may consider an older GPS location "better" than a more current one that is (much) less precise.

It would be more helpful @sjvudp if that GPSTest was in Status mode (so we could see PDOP & H/V DOP & E H/V Acc)

Also, IIRC SCEE had some changes in handling that case, so it might (should?) behave differently.
Would be interesting if you could test both SC and SCEE when such GPS-disconnect happens.

@sjvudp
Copy link
Author

sjvudp commented Oct 8, 2024

Having had similar problems with Street Complete recently, my guess is that some position filter has problems updating the position under some conditions. I had even suspected that the map has an offset when the positions were all consistently "off".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feedback required more info is needed, issue will be likely closed if it is not provided
Projects
None yet
Development

No branches or pull requests

3 participants