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

Cameras and marks not showing on map #58

Open
GillesJ opened this issue Jun 19, 2019 · 3 comments
Open

Cameras and marks not showing on map #58

GillesJ opened this issue Jun 19, 2019 · 3 comments

Comments

@GillesJ
Copy link

GillesJ commented Jun 19, 2019

I noticed that there are no cameras shown on my map when I went for a mapping walk today.
None of the cameras I marked showed up either.
It was a fresh install on Lineage OS 16 (Android 9).
My location was shown correctly.
Source is FDroid, current version.

@milo-trujillo
Copy link
Member

This is... odd. The API has not changed, and the server seems to be responding to requests correctly with the iOS client. On Android, I see the same behavior as you. The logs complain that the position is NULL, despite the device clearly having location data and displaying the user position on the map.

@milo-trujillo
Copy link
Member

This is definitively a problem in the Android code. Specifically, the error is in DownloadPinsTask.java:

// Here we round our GPS coordinates to gross approximations for anonymity
if( p.position == null ) {
    Log.d("GPS", "Position is null!!");
    return null;
}

This should only occur when the app is first starting and doesn't yet have position data, or if permissions are set wrong and prevent the app from getting location data. The data is sent from GPS.java:

    public void onLocationChanged(Location loc) {
        // If this is our first location update just prime everything
        if( position == null || lastKnown == null ) {
            Log.d("GPS", "Initial ping, downloading first pins.");
            position = loc;
            lastKnown = new Date();
            new DownloadPinsTask().execute(new PinData(new HashMap<LatLng, Integer>(), map, position));
            return;
        }

Which should... update the position as soon as we receive non-null location data, and then send a new HTTP request. Given that this has been working for years, and we have not pushed an update in quite some time, my guess is something has changed in the Android API or OS permissions system, so our approach is no longer correct.

@milo-trujillo
Copy link
Member

The app is functioning correctly on at least some Android devices (@tfdahlin confirmed), so this may be vendor or OS-version specific. Just to confirm, can you check that location permissions for the app are enabled, restart the app, and verify that the cameras don't show up when you're zoomed out? This is obviously a bug no matter what, but perhaps it's poor handling of permissions changes rather than a flaw in the area of code I highlighted.

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

No branches or pull requests

2 participants