I'm trying to display the daily active minutes in a DF:
function compute() { var activityMonitorInfo = ActivityMonitor.getInfo(); if (activityMonitorInfo has :activeMinutesDay && activityMonitorInfo.activeMinutesDay != null) { // ciq_2_1_0 value = (activityMonitorInfo.activeMinutesDay as ActiveMinutes).total; } return value; }
I thought it'll return the time including the current activity (which I see is increasing in Activity.getActivityInfo().timerTime). At the beginning I thought it might be a bug in the simulator, but now I saw on fr965 that it's also not increasing on the real device. Is this my misunderstanding or bad wording of the documentation?
Is the right thing to do:
function compute(info as Activity.Info) { var activityMonitorInfo = ActivityMonitor.getInfo(); if (activityMonitorInfo has :activeMinutesDay && activityMonitorInfo.activeMinutesDay != null && info.timerTime != null) { // ciq_2_1_0 value = (activityMonitorInfo.activeMinutesDay as ActiveMinutes).total + info.timerTime / 60000; } return value; }
Or are devices where this will count the current activity twice?