Ticket Created
over 4 years ago

WERETECH - 9912

Wrong Widget lifetime flow in Edge 530

I've been looking into an issue related to Widgets on Edge devices. Looks like the app and view lifetime is not correct with widgets:

For reference, here are printfs from Watch App type, where things and sequence is correct:

BSApp::onStart: 13:40:41 Wed 21 OCT 2020  <-- First start
BSView::onLayout
BSView::onShow
BSView::onHide
BSApp::onStop: 13:40:51 Wed 21 OCT 2020   <-- First exit

BSApp::onStart: 13:40:54 Wed 21 OCT 2020  <-- Second start

This looks normal flow, and I don't have issues with it.

But with Widget type, there is problem where onStop() of previous widget exit is coming after onStart() of next widget start:

BSWidget::onStart: 13:39:21 Wed 21 OCT 2020 <— First start
BSView::onLayout
BSView::onShow
BSView::onHide                              <— Exiting the widget, onStop() should come after this

BSWidget::onStart: 13:39:36 Wed 21 OCT 2020 <— Second start, onStart() becomes before previous onStop()
BSView::onLayout
BSView::onShow
BSWidget::onStop: 13:39:36 Wed 21 OCT 2020  <— This onStop() is coming too late

This behaviour is messing up my widget, because I'm doing some cleanup at onStop(), and it breaks the functionality if this happens while widget is starting.

I haven't checked in detail with watches, but quickly looking it is not issue on those. So looks like it is only happening on Edge 530 (and perhaps others in the family). This was tested on real device, cannot test this kind of exit - start scenario on simulator.

Parents Comment Children