Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

No location update after reconnect (LOST 3.0.2) #233

Closed
westnordost opened this issue Jul 6, 2017 · 3 comments · Fixed by #234
Closed

No location update after reconnect (LOST 3.0.2) #233

westnordost opened this issue Jul 6, 2017 · 3 comments · Fixed by #234
Assignees

Comments

@westnordost
Copy link
Contributor

westnordost commented Jul 6, 2017

Description

After stopping location updates (through tabbing out / changing Activity) and disconnecting from LOST api client, when it is attempted to reconnect later and request location updates anew, onLocationChanged is never called.

Steps to Reproduce

For StreetComplete: Turn on location. Tab out or go to settings activity, then go back. The GPS button does not stop blinking (=app is waiting for a location update but does not get one).

Program flow:

  1. MainActivity.onStart(): locationRequestFragment.startRequest(); is called which ensures that the app has all the permissions and location is enabled. It then calls
  2. MainActivity.onLocationIsEnabled(): The GPS button is made to blink. singleLocationRequest.startRequest (source) connects to LOST, on connection requests location updates and then would, on receiving the first location update, make the GPS button stop blinking. The location update never comes.

Edit: Now after 5-10 minutes, the location update was received.

Lost & Android Version

LOST 3.0.2

@westnordost
Copy link
Contributor Author

Additional information: With earlier versions (except the ones that crashed), a location update was available practically immediately when tabbing out and then in.

westnordost added a commit to streetcomplete/StreetComplete that referenced this issue Jul 6, 2017
@westnordost
Copy link
Contributor Author

(The revert is only for the stable v0.13. On master, LOST 3.0.2 is still used)

@sarahsnow1
Copy link
Contributor

The reason the initial location request is not received is because state is not cleared in the class which handles sending location updates when the service is shutdown. So, an initial location is attempted to be sent but is not deemed "good enough" and is therefore ignored.

https://github.com/mapzen/lost/blob/master/lost/src/main/java/com/mapzen/android/lost/internal/LostClientManager.java#L299-L304

Thanks for the report, I'll post a fix shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants