Using System.getDeviceSettings().activityTrackingOn

Instead of activity elapsed time. Also forgot to update the WebhookManager class code.
This commit is contained in:
Philip Abbey
2024-01-28 19:52:20 +00:00
parent 66193f080a
commit 55423c4eb7
2 changed files with 21 additions and 8 deletions

View File

@ -105,8 +105,9 @@ class BackgroundServiceDelegate extends System.ServiceDelegate {
if ((Activity has :getActivityInfo) and (Activity has :getProfileInfo)) {
var activity = Activity.getProfileInfo().sport;
var sub_activity = Activity.getProfileInfo().subSport;
// We need to check if we are actually tracking any activity
if (Activity.getActivityInfo().elapsedTime == 0) {
// We need to check if we are actually tracking any activity as the enumerated type does not include "No Sport".
System.println("activityTrackingOn = " + System.getDeviceSettings().activityTrackingOn);
if (!System.getDeviceSettings().activityTrackingOn) {
// Indicate no activity with -1, not part of Garmin's activity codes.
// https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html#Sport-module
activity = -1;