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

Commit f460f295 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Correct help on how bg-dexopt-job interacts with the job scheduler.

The intentional and documented behaviour from commit cb5f41ea was that a
job started through `cmd package bg-dexopt-job` would run concurrently
with one started by the job scheduler. However this changed in commit
f992cb31 when cancellation was added and runIdleOptimizationsNow got
removed.

Also document that bg-dexopt-job takes an optional list of packages.

#codehealth

Test: n/a
Bug: 179094324
Bug: 156537504
Change-Id: I53db26c9244b240fe2b198b396c5a2fbd9d16ada
parent 5ccead10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ public final class BackgroundDexOptService {

    /**
     * Cancels currently running any idle optimization tasks started from JobScheduler
     * or runIdleOptimizationsNow call.
     * or runIdleOptimization call.
     *
     * <p>This is only for shell command and only root or shell user can use this.
     */
+12 −9
Original line number Diff line number Diff line
@@ -4209,17 +4209,20 @@ class PackageManagerShellCommand extends ShellCommand {
        pw.println("  delete-dexopt PACKAGE");
        pw.println("    Delete dex optimization results for the given PACKAGE.");
        pw.println("");
        pw.println("  bg-dexopt-job");
        pw.println("  bg-dexopt-job [PACKAGE...]");
        pw.println("    Execute the background optimizations immediately.");
        pw.println("    Note that the command only runs the background optimizer logic. It may");
        pw.println("    overlap with the actual job but the job scheduler will not be able to");
        pw.println("    cancel it. It will also run even if the device is not in the idle");
        pw.println("    maintenance mode.");
        pw.println("    Optimize only the given PACKAGEs, or all packages if none is specified.");
        pw.println("    Note that the command only runs the background optimizer logic. It will");
        pw.println("    run even if the device is not in the idle maintenance mode. If a job is");
        pw.println("    already running (including one started automatically by the system) it");
        pw.println("    will wait for it to finish before starting. A background job will not be");
        pw.println("    started automatically while one started this way is running.");
        pw.println("  cancel-bg-dexopt-job");
        pw.println("    Cancels currently running background optimizations immediately.");
        pw.println("    This cancels optimizations run from bg-dexopt-job or from JobScjeduler.");
        pw.println("    Note that cancelling currently running bg-dexopt-job command requires");
        pw.println("    running this command from separate adb shell.");
        pw.println("    Cancels any currently running background optimization job immediately.");
        pw.println("    This cancels jobs started either automatically by the system or through");
        pw.println("    the bg-dexopt-job command. Note that cancelling a currently running");
        pw.println("    bg-dexopt-job command requires running this command from a separate adb");
        pw.println("    shell.");
        pw.println("");
        pw.println("  reconcile-secondary-dex-files TARGET-PACKAGE");
        pw.println("    Reconciles the package secondary dex files with the generated oat files.");