Ticket Created
over 3 years ago

CIQQA-1144

no body battery after restarting watch

In my WF's view.initialise I Have a code

mHasSensorHistory            = Toybox                  has :SensorHistory;

After I reset my watch f6p (probably when restart it too) it doesn't shows body battery until I quit and return to WF.

It means code above set mHasSensorHistory  to false .

Is does mean that system has dynamic members? What exactly HAS check?

  • It would have to be a big coincidence because I have seen it several times

    I read BB in every onExitSleep checking first mHasSensorHistory so after several onExitSleep should have BB but don't. BB is visible only after quit and return to WF.

    It means that probably sensor history is started after few moments after restart (also HR and SpO2 but I don't use history fro them) - WF starts faster than sensorhistory.

    But it means that in case on sensorhistory HAS not check modules but any variable witch is visible for has after it starts.

  • The has check is a runtime check that looks for the existence of a symbol inside a module/class. It is a runtime check, but the data structure that it queries is fixed at compile time.

    Seems more likely that mHasSensorHistory is true and SensorHistory.getBodyBatteryHistory() is returning an empty iterator. Right? Would that be consistent with what you're seeing in your app?

    If you reset your device, I'd expect there to be no saved body battery data as that should be getting wiped out when you do the reset. I'm not certain, but I believe body battery data will survive a device reboot, so you should not see this problem after a restart.