Skip to content

Commit 38cb016

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "Disable Pre-reboot Dexopt." into main
2 parents 91cb820 + 3efe8ed commit 38cb016

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

cmds/installd/otapreopt_script.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,6 @@ else
5050
exit 1
5151
fi
5252

53-
# A source that infinitely emits arbitrary lines.
54-
# When connected to STDIN of another process, this source keeps STDIN open until
55-
# the consumer process closes STDIN or this script dies.
56-
function infinite_source {
57-
while echo .; do
58-
sleep 1
59-
done
60-
}
61-
62-
PR_DEXOPT_JOB_VERSION="$(pm art pr-dexopt-job --version)"
63-
if (( $? == 0 )) && (( $PR_DEXOPT_JOB_VERSION >= 2 )); then
64-
# Delegate to Pre-reboot Dexopt, a feature of ART Service.
65-
# ART Service decides what to do with this request:
66-
# - If Pre-reboot Dexopt is disabled or unsupported, the command returns
67-
# non-zero. This is always the case if the current system is Android 14 or
68-
# earlier.
69-
# - If Pre-reboot Dexopt is enabled in synchronous mode, the command blocks
70-
# until Pre-reboot Dexopt finishes, and returns zero no matter it succeeds or
71-
# not. This is the default behavior if the current system is Android 15.
72-
# - If Pre-reboot Dexopt is enabled in asynchronous mode, the command schedules
73-
# an asynchronous job and returns 0 immediately. The job will then run by the
74-
# job scheduler when the device is idle and charging.
75-
if infinite_source | pm art on-ota-staged --slot "$TARGET_SLOT_SUFFIX"; then
76-
# Handled by Pre-reboot Dexopt.
77-
exit 0
78-
fi
79-
echo "Pre-reboot Dexopt not enabled. Fall back to otapreopt."
80-
else
81-
echo "Pre-reboot Dexopt is too old. Fall back to otapreopt."
82-
fi
83-
8453
if [ "$(/system/bin/otapreopt_chroot --version)" != 2 ]; then
8554
# We require an updated chroot wrapper that reads dexopt commands from stdin.
8655
# Even if we kept compat with the old binary, the OTA preopt wouldn't work due

0 commit comments

Comments
 (0)