BUG? GPS Enabled when Recording Session is active

Hi -
I've been having a lot of issues trying to get the GPS to be disabled in my Gym Set/Timer app.
Despite

1) Asking explicitly for GPS and disabling it
2) NOT asking for GPS

both of the above will STILL turn on GPS.

I then tried other means..

I initially tot that it's because of my SUB_SPORT / SPORT that I was selecting - but didn't look that way, then I tried to change an existing program that was not using recording session and altered it to be a recording session. Wah lah!!..

I took the example from the SDK - TIMER

//!
//! Copyright 2015 by Garmin Ltd. or its subsidiaries.
//! Subject to Garmin SDK License Agreement and Wearables
//! Application Developer Agreement.
//!

using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.Timer as Timer;
//////////////////////////// ADDED ////////////////////////
using Toybox.ActivityRecording as Record;
//////////////////////////// ADDED ////////////////////////

var timer1;
var timer2;
var timer3;
var count1 = 0;
var count2 = 0;
var count3 = 0;
//////////////////////////// ADDED ////////////////////////
var session;
//////////////////////////// ADDED ////////////////////////

class MyWatchView extends Ui.View
{
function callback1()
{
count1 += 1;
Ui.requestUpdate();
}

function callback2()
{
count2 += 1;
Ui.requestUpdate();
}

function callback3()
{
count3 += 1;
Ui.requestUpdate();
}

function onLayout(dc)
{
timer1 = new Timer.Timer();
timer2 = new Timer.Timer();
timer3 = new Timer.Timer();

timer1.start( method(:callback1), 500, true );
timer2.start( method(:callback2), 1000, true );
timer3.start( method(:callback3), 2000, true );
}

function onUpdate(dc)
{
var string;
//////////////////////////// ADDED ////////////////////////
if ( ( session == null ) || ( session.isRecording() == false ) ) {
session = Record.createSession({:name=>"Strength", :sport=>Record.SPORT_GENERIC, :subSport=>Record.SUB_SPORT_STRENGTH_TRAINING});
session.start();
}
//////////////////////////// ADDED ////////////////////////

dc.setColor( Gfx.COLOR_BLACK, Gfx.COLOR_BLACK );
dc.clear();
dc.setColor( Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT );
string = "Count: " + count1;
dc.drawText( 40, (dc.getHeight() / 2) - 30, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Count: " + count2;
dc.drawText( 40, (dc.getHeight() / 2), Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Count: " + count3;
dc.drawText( 40, (dc.getHeight() / 2) + 30, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
}

}

class InputDelegate extends Ui.BehaviorDelegate
{
function onMenu()
{
timer1.stop();
}
}



and in the manifest file I added the request for FIT File Permission
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest xmlns:iq="www.garmin.com/.../connectiq" version="1">
<iq:application entry="MyApp" id="DA90CADD868440BE82D1C65E3942BDAB" launcherIcon="LauncherIcon" name="AppName" type="watch-app">

<iq:products>
<iq:product id="square_watch"/>
<iq:product id="round_watch"/>
</iq:products>

<iq:permissions>
<iq:uses-permission id="Fit"/>
</iq:permissions>

<iq:languages>
</iq:languages>

</iq:application>
</iq:manifest>




i compiled the program, installed it and then ran the one w/ and w/o the Recording session.
when i LONG Press the DOWN key, I will get to the digital clock, on the digital clock face, on the

1) w/o recording session - i do NOT see the words GPS
2) w/ the recording session - I see the words GPS


I'm running this on an F3 on FW 4.0 CIQ 11.3

Please help to verify if the behaviour is intended (which I'm guessing it's NOT)
  • i compiled the program, installed it and then ran the one w/ and w/o the Recording session.
    when i LONG Press the DOWN key, I will get to the digital clock, on the digital clock face, on the

    1) w/o recording session - i do NOT see the words GPS
    2) w/ the recording session - I see the words GPS

    I can't make any sense of this. If you compiled and ran the above code, you have no choice-- it will always record a session and it has no code to produce the word GPS anywhere. What are you omitting?

    Travis
  • Travis -

    U missed out that you need to LONG press the DOWN button to get to the digital watch. When in the digital watch face, u will see the words GPS there which indicates that GPS is turned on.

    When code is compiled w/o starting a session (just basically the bundled in Timer code in the SDK, doing the same thing will not enable GPS - again - I based this on the digital watch face)

    Hope that makes more sense??
  • When recording, do you have any GPS data in the .fit file? I can't see how that would be the case. Could the "gps" on the default watchface just mean it's available, not that it's used?
  • On my app - (per my other thread response)

    GPS Permission in manifest file. Activity recording. GPS called for in OnStart - I get s map and a track. (I take it driving)
    GPS not on manifest file. Activity recording. GPS not called for in onstart. I still get a map and a track

    The timer app in the SDK -
    I didn't test to see if a map exists. But the GPS word just shows up in the watchface when activity recording is enabled (w/o asking for GPS to be enabled)

    On native INDOOR run app, when u do the long press Dn, the watchface, u don't see the word GPS.
    On native pa OUTDOOR run app, doing the same u see the words GPS

    I take that as definitive.


  • That's the track from using the above prg

    https://www.dropbox.com/sh/0f0fo2snxc6bp2s/AAA7fDiLjmZv-E8rIjEjXsKqa?dl=0

    The Dropbox link has the app for both the timer programs. Named for the one with recording enabled and the original one from the SDK
  • You have a lot of stuff going on here. You're discussing one problem (you're inability to disable GPS for your strength training app), but then you go off in a totally different direction to talk about a new problem. Your posts would be much easier to understand if only the relevant information was provided.

    First off, it sounds like the new problem you are seeing can be summed up in a single sentence...

    An application that does not have permission to access GPS data (disabled in the manifest) appears to enable the GPS and record position data in the fit file of a recording session


    Is that correct?

    Secondly, I have no problem enabling or disabling recording of position data in my testing. I used this simple test program to test four scenarios...

    • gps explicitly enabled [here]
    • gps explicitly disabled [here]
    • gps not explicitly set [here]
    • gps enabled and disabled intermittently [here]


    This testing worked exactly like I expected it to on a fr920xt using the 5.20 firmware. I've got no idea how it will work with a fenix3, but I see no reason it should not work other than a firmware bug.

    Travis
  • haha... sorry about that. the problems are interlinked cos i was trying to figure out why I cant get the GPS to be disabled. Then I tried a sample prog to test out a theory and thus spawned this thread.

    but you're right - your summation is correct.

    An application that does not have permission to access GPS data (disabled in the manifest) appears to enable the GPS and record position data in the fit file of a recording session

    It seems to me that this is not a bug. As I see it, the permission system is supposed to control whether or not an app can access the functionality protected by the given permission. As long as your app doesn't get access to the Position module, then the permission system is doing what it is supposed to. I don't believe that you need permission for the Sensor module to be able to capture sensor data (speed, cadence, heart rate, ...) in an activity recording, so there are at least



    To me, it is a BUG, because when i ask for FIT file access, that means I want to record a session. However, since i did not specifically asks for GPS position / access, the GPS should not be enabled / or turned on. (Should it not be that the permission system specifically needs me to ask for Position / FIT access to be able to use these features?)

    As for the sensor permission, it seems like it's a mixed permission, possibly due to the way the data is aggregrated between all the available data. Speed = (either speed from GPS or speed from Bike Sensor or speed from footpod). (I postulate) You don't need to ask for sensor access unless you want something external perhaps like the Tempe sensor. (or something which is not aggregrated as a combined data. perhaps in future - if the footpod speed vs GPS speed is separate, I would need to explicitly ask for sensor access to get to the footpod)


    Perhaps the permission system is based on Inheritance / Parent-Child? If yes, the assumption is when I ask for :
    - FIT file access, GPS gets enabled by default. (inheritance? and needs to be disabled explicitly?)
    - Positioning Access - I only get GPS enabled but no fit file. (like the PositionPlus App)

    Is there documentation as to the inheritance of each of the permission systems?

    I re-looked at the Prog Guide, on the permission system it states
    PERMISSIONS
    Certain modules expose personal information about the user or expose communication to the internet. To use these modules you must request permission from the user at installation time.


    Positioning most certainly exposes personal info and communicates to the Internet (after upload to GC). Permission should be required no?
  • I took your colors app for a drive, while I am not entirely sure if my process is correct, but here's what I did.
    1) start the app
    2) press menu
    3) change GPS to disabled state
    4) start recording
    5) drive
    6) press stop
    7) press esc



    So, it's either a FW bug or just a feature of the F3. Lol..

    Waiting for the CIQ guys to comment.
  • Former Member
    Former Member over 10 years ago
    If the GPS is coming on during FIT recording without a call to enableLocationEvents(), then something is not working as intended. Something is clearly wrong if GPS is coming on without the permission set. We will have to investigate this with the device team.
  • Brian -

    I presume that you took our example programs for testing?
    And confirmed that the situation is not intended behavior?