Ticket Created
over 4 years ago

WERETECH-10061

Wrong Activity.getActivityInfo().currentLocation on fenix 6 pro

I seems that Activity.getActivityInfo().currentLocation returns a position object with lat/lon coordinates of 0 (zero), instead of returning null.

In watch faces, Activity.getActivityInfo().currentLocation is used to get current or recent GPS position retrieved by GPS fix from last activity.

When GPS fix expired after some time, Activity.getActivityInfo().currentLocation should return null.

But on my fenix 6 pro it seems to return a position object with lat/lon coordinates of 0.

Code used in watch face:

var location;
var locationArray;

location = Activity.getActivityInfo().currentLocation;
if (location != null) {
   locationArray = location.toDegrees();
}
-
On my fenix 6 pro location var is not null and locationArray is [0.000000, 0.000000]
On my forerunner 645 location var is null, which is correct.
Simulator is also correct with fenix 6 (pro).
  • I don't know. But it happened just once and the next call returned the right coordinates despite the fact there was no GPS fix. 

    I don't check for it, because it is not documented how to use it. Especially when QUALITY_NOT_AVAILABLE and when QUALITY_LAST_KNOWN is returned. When I tried to reverse-engineer it by debugging QUALITY_NOT_AVAILABLE was correct location was returned. 

    I have a hypotheses that the QUALITY_NOT_AVAILABLE might be returned when the location is acquired through the phone rather than a GPS fix. 

    But I really don't have clue how Garmin guys did this and I am not aware of any documentation of it. 

  • what was the quality/accuracy of GPS at the time?

  • It was on a real device indoors. 

  • If you see that in the sim, it means that GPS was lost in the file you are playing back.  I ran into this 5-6 years ago when part of a track went through a tunnel.

    On a real device the quality changes, but that doesn't happen in the sim.

  • Even buggier than we might expect: Toybox.Position.Info.position returned [180,180].