Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9b563a2 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12337407 from 0984bd2d to 25Q2-release

Change-Id: Id426180d814d356334a3ce2e33bef069ec6a0017
parents a5de4967 0984bd2d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -24,3 +24,7 @@ on post-fs
    chmod 0666 /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/filter
    chmod 0666 /sys/kernel/tracing/events/raw_syscalls/sys_exit/filter
    chmod 0666 /sys/kernel/debug/tracing/events/raw_syscalls/sys_exit/filter

    # Allow traced_probes to use the kprobe interface
    chmod 0666 /sys/kernel/debug/tracing/kprobe_events
    chmod 0666 /sys/kernel/tracing/kprobe_events
+31 −0
Original line number Diff line number Diff line
@@ -50,6 +50,37 @@ else
  exit 1
fi

# A source that infinitely emits arbitrary lines.
# When connected to STDIN of another process, this source keeps STDIN open until
# the consumer process closes STDIN or this script dies.
function infinite_source {
  while echo .; do
    sleep 1
  done
}

PR_DEXOPT_JOB_VERSION="$(pm art pr-dexopt-job --version)"
if (( $? == 0 )) && (( $PR_DEXOPT_JOB_VERSION >= 3 )); then
  # Delegate to Pre-reboot Dexopt, a feature of ART Service.
  # ART Service decides what to do with this request:
  # - If Pre-reboot Dexopt is disabled or unsupported, the command returns
  #   non-zero. This is always the case if the current system is Android 14 or
  #   earlier.
  # - If Pre-reboot Dexopt is enabled in synchronous mode, the command blocks
  #   until Pre-reboot Dexopt finishes, and returns zero no matter it succeeds or
  #   not. This is the default behavior if the current system is Android 15.
  # - If Pre-reboot Dexopt is enabled in asynchronous mode, the command schedules
  #   an asynchronous job and returns 0 immediately. The job will then run by the
  #   job scheduler when the device is idle and charging.
  if infinite_source | pm art on-ota-staged --slot "$TARGET_SLOT_SUFFIX"; then
    # Handled by Pre-reboot Dexopt.
    exit 0
  fi
  echo "Pre-reboot Dexopt not enabled. Fall back to otapreopt."
else
  echo "Pre-reboot Dexopt is too old. Fall back to otapreopt."
fi

if [ "$(/system/bin/otapreopt_chroot --version)" != 2 ]; then
  # We require an updated chroot wrapper that reads dexopt commands from stdin.
  # Even if we kept compat with the old binary, the OTA preopt wouldn't work due
+119 B

File added.

No diff preview for this file type.

+119 B

File added.

No diff preview for this file type.

+119 B

File added.

No diff preview for this file type.

Loading