Acknowledged

OLED: font resources seem to be forgotten while sleeping which leads to a crash onExitSleep

It seems that OLED watches now release fonts when sleeping and onExitSleep is called before initialize, so the app crashes when it uses fonts in the onExitSleep to update the layout. 

I get null exception while a resource is expected on this line that is called from onExitSleep.

"UnexpectedTypeException: Expected Number/Resource, given null…"

I got thousands of failure reports on this line from a variety of OLED devices. 

I do not release fonts anywhere in the code and the same line is called via initialize without problems. 

I hotfixed it by catching the exception and calling the initialize instead, but that is a huge wasting of resources and probably a battery. 

I am not aware of any documentation that the Monkey might release any resources on its own and even if it does, I'd expect it would call initialize before onExitSleep. 

Some of devices where the error occurred: 

  • Venu® 3: 8.25
  • vívoactive® 5: 8.27, 4.14
  • Forerunner® 265s: 17.26

EDIT: added an exception text

EDIT2: added devices 

Parents
  • I don't call the onExitSleep  – the OLED device calls it itself without my intervention.

    Re: "You should never see fontSmall get set back to null."

    That's exactly what happens!

    The exception on that line using the font (previously loaded in initialize) is: "UnexpectedTypeException: Expected Number/Resource, given null…"

    Not sure if that exception continues, because there's no way how to reproduce it without the device. It does not show in a simulator. I don't have an OLED device, so I had to let it print to the device display and let my users to report it to me back.

    Contrary what _psx_ reported, my report is that onEnterSleep and onExitSleep are called correctly, but OLED watches often (not always) remove the font used on that line 
    (without my intervention) and it stays removed when the watch itself calls the onExitSleep. Thousands of reports from a variety of OLED watches. 

Comment
  • I don't call the onExitSleep  – the OLED device calls it itself without my intervention.

    Re: "You should never see fontSmall get set back to null."

    That's exactly what happens!

    The exception on that line using the font (previously loaded in initialize) is: "UnexpectedTypeException: Expected Number/Resource, given null…"

    Not sure if that exception continues, because there's no way how to reproduce it without the device. It does not show in a simulator. I don't have an OLED device, so I had to let it print to the device display and let my users to report it to me back.

    Contrary what _psx_ reported, my report is that onEnterSleep and onExitSleep are called correctly, but OLED watches often (not always) remove the font used on that line 
    (without my intervention) and it stays removed when the watch itself calls the onExitSleep. Thousands of reports from a variety of OLED watches. 

Children