Conversation

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
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
The modern update system since the Nexus 5X era is update_engine. It performs updates at a low priority in the background while you're using the device. Perhaps the issue is that Samsung has dragged their heels and STILL not adopted update_engine and other modern parts of the OS.
Replying to and
Yeah, that's the legacy update system replaced with update_engine on the Nexus 5X / 6P and which other vendors were supposed to have adopted ages ago. Seems Samsung still hasn't adopted it. The OS is designed around the A/B update system for atomic updates in the background.
1
1
Show replies