Ticket Created
over 4 years ago

VEGAS-6332

Transferred

error in Toybox.Activity

After few days of fight with crash my wf on some type of devices (for sure on fenix 5X 006-B2604-00  FV21.00 ciq 3.18 and probably on Venu Sq)  I 've discover cause - return null instead value.
getActivityInfo() ⇒ Toybox.Activity.Info
Get the current Activity Info.
Returns:
•    Toybox.Activity.Info —
The current Activity Info or null if there is no current activity.
not true (even on my fenix 6), it return object (not null) independently of it is activity (timer was started) or not, but ok, it can be useful if user sit or move.

Class: Toybox.Activity.Info
Inherits:
Toybox.Lang.Object show all
Overview
The Activity.Info class contains information about the current activity.
This information can be retrieved with the getActivityInfo() method. Fields in this class may return null so should be checked for null values prior to use.
ok, there is information that field may return null but in mostly documentation there is additional information on field description but here:

var timerState ⇒ Toybox.Lang.Number
The recording timer state.
The timer state ranges from 0-3. A value of 0 indicates that the timer is off and there is no active recording, while a value of 3 indicates timer is on and there is an active recording.
Returns:
•    Toybox.Lang.Number —
An Activity.TIMER_STATE_* value

there only information that it's TIMER_STATE_* value... and on in the above-mentioned devices it returns null instead of TIMER_OFF and TIMER_STOPED...
Even i check the null I can't obtain in noemal way if is activity off or stoped so I think it's error.


Parents Comment Children
No Data