Skip to content

Commit

Permalink
Add an API for apex staged.
Browse files Browse the repository at this point in the history
Bug: 323856738
Test: m update-api
Change-Id: I2165f6bc206eed612d0be61223e51898075e06b3
  • Loading branch information
jiakaiz-g committed Feb 9, 2024
1 parent 5d72ab3 commit 158c3ff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions libartservice/service/api/system-server-current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.android.server.art {
method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, int);
method public int handleShellCommand(@NonNull android.os.Binder, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull String[]);
method public void onApexStaged(@NonNull String[]);
method public void onBoot(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<com.android.server.art.model.OperationProgress>);
method public void printShellCommandHelp(@NonNull java.io.PrintWriter);
method public void removeDexoptDoneCallback(@NonNull com.android.server.art.ArtManagerLocal.DexoptDoneCallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,25 @@ public void onBoot(@NonNull @BootReason String bootReason,
}
}

/**
* Notifies ART Service that there are apexes staged for installation on next reboot (see
* <a href="https://source.android.com/docs/core/ota/apex#apex-manager">the update sequence of
* an APEX</a>). ART Service may use this to schedule a pre-reboot dexopt job. This might change
* in the future.
*
* This immediately returns after scheduling the job and doesn't wait for the job to run.
*
* @param stagedApexModuleNames The <b>module names</b> of the staged apexes, corresponding to
* the directory beneath /apex, e.g., {@code com.android.art} (not the <b>package
* names</b>, e.g., {@code com.google.android.art}).
*/
@SuppressLint("UnflaggedApi") // Flag support for mainline is not available.
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public void onApexStaged(@NonNull String[] stagedApexModuleNames) {
// TODO(b/311377497): Check system requirements.
mInjector.getPreRebootDexoptJob().schedule();
}

/**
* Dumps the dexopt state of all packages in text format for debugging purposes.
*
Expand Down

0 comments on commit 158c3ff

Please sign in to comment.