microg / microg/UnifiedNlp

LocationProvider sometimes returning NaN

Open
#150 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

Hi,

First of all, I'm not sure this is the right repo to post this issue. Please, let me know if it should belong to another repo and I'll fix it.

I'm using LineageOS with microg ROM on my Nexus 5, together with UnifiedNlp and Apple Wifi backend. I am also using [OwnTracks](http://owntracks.org/) (which relies on `FusedLocationProvider` as far as I know) to track my phone's position every 5 minutes and send the location to a remote server. My phone geolocation setting is always set to "power saving".

I noticed that from time to time, I receive a `NaN, NaN` location, which is directly coming from the `FusedLocationProvider` implementation, as far as I know. I'm not exactly sure what happens here, and I guess this might be actually a regular behavior of `FusedLocationProvider` (when it cannot acquire a location for instance). Still, apparently, from reading the official docs of this Google API, it should never return a `NaN` value.

This is not a really big deal in OwnTracks as it handles it quite fine, and simply implicitly converts it to zero and this can be filtered away afterwards on the server side. On the contrary, many apps I've encountered so far are not resilient to an unexpected `NaN` value here and simply crash.

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the intermittent NaN result with the reported LineageOS, microg, UnifiedNlp, Apple Wifi backend, Nexus 5, and power-saving setup. Inspect the FusedLocationProvider implementation and its handling when no location is available. Done means the cause is identified and the provider no longer exposes unexpected NaN coordinates, with a regression test if the project supports one.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.