Conversation

I have an android update that's taking multiple minutes. Considering that there's no network IO, it's kind of hard to imagine what sort of process could take multiple minutes. I don't really know what goes into such a thing - why is it so slow?
3
3
Replying to
All the app java code gets recompiled into byte code and rewritten to the dalvik cache after every update. After that, some of the oat files that contain startup functions are signed and need to be verified.
1
2
Replying to
Yeah I guess I was thinking that was the later part of the process. Idk it seems that there are two "stages" from a UX perspective. The latter being when it recompiles apps etc
1
Replying to
I don’t remember the exact order of the steps during an OTA android update but iirc the zygote service is stopped so all the apps are recompiled before reboot
1
1
Replying to and
Which version of Android, on which device? If you're talking about a modern device with A/B updates, you can watch the update_engine progress with `adb logcat`. On modern, stock OS devices, they usually use a mix of interpreter + JIT + AOT compilation driven by JIT profiles.
2
1
During the update process in the background, once it finishes installing and verifying the new update, it starts redoing AOT compilation of apps driven by the JIT profiles gathered from the existing usage. It also recompiles code daily when not low battery + plugged in and idle.
1
1
This avoids blocking the boot process for it (which was the initial implementation) or doing it in the background after reboot which results in poor performance due to only having the interpreter / JIT compiler. GrapheneOS doesn't use the JIT and we just use full AOT compilation.
1
Show replies