View Single Post
Old 05-24-2021, 05:05 AM   #8
pazos
cosiņeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by NiLuJe View Post
@pazos: Re-reading the issue and what you said there about STOP, can we actually run Lua code after that event, or will Android say "nope, I'm freezing that activity", hence the potential ANR?

(Looking at the handlers, it's mostly I/O and task (un)scheduling, but code nonetheless ^^).
The thread with the LuaJIT instance should be ready to execute chunks of lua when the activity is stopped. Anything network related or window related will fail when the activity isn't in the foreground.

Not very familiar with UIManager, but it looks that both "Suspend" and "Resume" are no-op in Android, so I guess we can remove them: https://github.com/koreader/koreader...ua#L1761-L1772.

If they're doing something we can broadcast them onResume/onPause instead onStart/onStop.

onStop callback isn't very reliable and most devices never reach that state unless we request an explicit destroy using finish()
pazos is offline   Reply With Quote