Conversation

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
Replying to and
The update it installed to the alternate set of partitions, so it mounts the alternate system partition and then uses that to recompile the apps for the upcoming reboot into the newly updated OS. It can't reuse the existing AOT compiled code.
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
It doesn't have to recompile system apps that are shipped with pre-compiled code and don't have an out-of-band update installed. However, it's increasingly uncommon to include pre-compiled code in the OS images for everything but the core privileged code (for verified boot).
1
GrapheneOS ships fully pre-optimized code and we don't have out-of-band updates to any of the bundled apps other than Vanadium (WebView, browser, library), Auditor and PDF Viewer which are signed with their own keys. All other apps share the AOSP release cycle so no reason to.
1
Samsung probably has a huge number of bundled apps and they probably don't ship pre-compiled code, so your device has to go through all of them and recompile them. If they leave AOT compilation on speed-profile, it will only actually AOT compile code being used at runtime.
1
Replying to and
I guess the thing is that it sort of feels like a lot of that work doesn't have to happen strictly offline with my phone off, though perhaps that's done more as a precaution? Obviously at some point the phone is going to have to restart.
1
Replying to and
It doesn't - it happens in the background while you're using the phone. I now realize that Samsung probably isn't using the current official Android update system (A/B updates) yet. Are they still doing updates with a legacy recovery-based system? Not really what Android does.
2