View Single Post
Old 08-15-2013, 07:57 PM   #1034
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by NiLuJe View Post
... possibly a race condition somewhere where KUAL tries to do stuff before the Kindlet jailbreak has had time to do its thing? @ixtab: I vaguely remember this being the reason you use a 'loading screen' for CM & JBPatch?.
Yep, something along these lines. I could never really put my finger on it (if I could, I would have fixed it), but the Kindlet Jailbreak is indeed a bit touchy with the timing. If one tries to use permissions too soon after they have been requested, they will throw an AccessControlException. I don't know why that is, because the KJB code is essentially single-threaded. So it must be something further down the line (in the policy implementation, or even in the JVM/cvm itself).

That said, the splash screens in CM and JBPatch are there for a different reason: the init() method of a Kindlet can take at most 5 seconds (of which -- subjectively -- 3 seconds are already consumed by the Kindlet framework itself). So to make the Kindle happy, I only display a splash screen and return immediately, while all of the actual initialization work is happening in a new thread in the background, which finally updates the UI once the initialization is complete.
ixtab is offline   Reply With Quote