Quote:
Originally Posted by NiLuJe
... 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.