Acknowledged

AppBase.onBackgroundData requires Application.PersistableType, whereas Background.getBackgroundData and Background.exit use Application.PropertyValueType

As per the subject, there is a type discrepancy in the API.

Now, Application.PersistableType is actually defined to be the same as Application.PropertyValueType, which is fine, but Background.getBackgroundData and Background.exit should still be listed as using Application.PersistableType for consistency.

In addition, it would be REALLY good if Application.PersistableType (and/or Application.PropertyValueType) could be extended to include Graphics.BitmapReference and Graphics.FontReference so that these objects can be passed to the foreground through Background.exit. I can't see any reason why this shouldn't be done. It otherwise requires using Storage.set/getValue, which is a heavy-handed approach for sending a tiny object.

  • It is also a bit anomalous that if you want to store a "reference" to a 1MB image, it requires 1MB of storage!

    At least this explains why you can't store a BitmapReference using Properties.setValue().

  • Yes, I agree those runtime errors are annoying. Perhaps it could be a separate bug report that "instanceof BitmapReference" and "instance of BitmapResource" are not allowed in a background service.

  • Yes, but I would maintain that it is a bit anomalous that we have a callback function that accepts parameters of various types, and when we try "instanceof" to see which type we have, it fails at runtime.

  • I would not say that the "Permission Required" error due to "instanceof Graphics.BitmapReference" implies that "[the] background appears to be faking that it has a BitmapReference, when it actually has a BitmapResource."

    A similar error happens with "instanceof Graphics.BitmapResource":

    Error: Permission Required Details:
    Module 'Toybox.WatchUi' not available to 'Background'

    By the same logic as above, I would have to say that the background does not actually have a BitmapResource either, but I doubt either of us would agree with that.

    I think it just indicates that background services aren't allowed to do stuff with graphics.

  • Note to Garmin employees: I had to spend a ton of time editing the previous comment for it to be accepted by the forums.

    The same thing happens any time I try to post anything about CIQ, since it invariably involves some combo of parens, code, or formatting.

    I'm really getting sick of fighting with the forum just to post stuff.

    As with the last time this happened (several years ago), it's really making me consider leaving and never coming back (no big loss, I know).