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)
  • Former Member
    Former Member over 10 years ago
    I have not tested anything yet, but GPS turning on without permissions or a call to enableLocationEvents() is incorrect behavior.
  • so what you are saying essentially is that permission is required explicitly for GPS to be enabled.
  • NIKEOW,

    From what I see on a va, the permission for "positioning" needs to be set so that you can enable GPS, but unless you do call enableLocationEvents(), GPS isn't enabled.
  • Former Member
    Former Member over 10 years ago
    From what I see on a va, the permission for "positioning" needs to be set so that you can enable GPS, but unless you do call enableLocationEvents(), GPS isn't enabled.


    This is correct. The permission is required for GPS to be used at all. If you do have GPS permission, it should enable only when you call enableLocationEvents(LOCATION_CONTINUOUS, method(:callback)). You can disable GPS with enableLocationEvents(LOCATION_DISABLE, null).
  • Just to be clear, the behavior that is being reported and believed to be a bug is that position data is being recorded when the permission for the Position module isn't enabled. i.e., An application doesn't enable the Position permission bit, does not call Position.enableLocationEvents(), but position data is still recorded in the .fit file when using the ActivityRecording module.

    We can tell developers to disable position data until we are blue in the face, it doesn't do anything to prevent the permission violation.

    Travis
  • hence

    For the 920 - the bug is that position permission is enabled even when not explicitly asked for even tho fit is requested.
    For the f3 - the big is that when fit is asked for, it throws in GPS at the same time
  • For the 920 - the bug is that position permission is enabled even when not explicitly asked for even tho fit is requested.
    For the f3 - the big is that when fit is asked for, it throws in GPS at the same time


    Don't both of these sentences say the exact same thing?
  • just wondering if there is any progress into the investigation?
  • hi CIQ folks - has there been any traction on this item?