xref: /aosp_15_r20/prebuilts/sdk/extensions/7/system-server/api/service-art.txt (revision 344a7f5ef16c479e7a7f54ee6567a9d112f9e72b)
1*344a7f5eSAndroid Build Coastguard Worker// Signature format: 2.0
2*344a7f5eSAndroid Build Coastguard Workerpackage com.android.server.art {
3*344a7f5eSAndroid Build Coastguard Worker
4*344a7f5eSAndroid Build Coastguard Worker  public final class ArtManagerLocal {
5*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public ArtManagerLocal();
6*344a7f5eSAndroid Build Coastguard Worker    ctor public ArtManagerLocal(@NonNull android.content.Context);
7*344a7f5eSAndroid Build Coastguard Worker    method public void addDexoptDoneCallback(boolean, @NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.DexoptDoneCallback);
8*344a7f5eSAndroid Build Coastguard Worker    method public void cancelBackgroundDexoptJob();
9*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public void clearAppProfiles(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
10*344a7f5eSAndroid Build Coastguard Worker    method public void clearBatchDexoptStartCallback();
11*344a7f5eSAndroid Build Coastguard Worker    method public void clearScheduleBackgroundDexoptJobCallback();
12*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DeleteResult deleteDexoptArtifacts(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
13*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptResult dexoptPackage(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull com.android.server.art.model.DexoptParams);
14*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptResult dexoptPackage(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull com.android.server.art.model.DexoptParams, @NonNull android.os.CancellationSignal);
15*344a7f5eSAndroid Build Coastguard Worker    method public void dump(@NonNull java.io.PrintWriter, @NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot);
16*344a7f5eSAndroid Build Coastguard Worker    method public void dumpPackage(@NonNull java.io.PrintWriter, @NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
17*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String);
18*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptStatus getDexoptStatus(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, int);
19*344a7f5eSAndroid Build Coastguard Worker    method public int handleShellCommand(@NonNull android.os.Binder, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull String[]);
20*344a7f5eSAndroid Build Coastguard Worker    method public void onBoot(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<com.android.server.art.model.OperationProgress>);
21*344a7f5eSAndroid Build Coastguard Worker    method public void printShellCommandHelp(@NonNull java.io.PrintWriter);
22*344a7f5eSAndroid Build Coastguard Worker    method public void removeDexoptDoneCallback(@NonNull com.android.server.art.ArtManagerLocal.DexoptDoneCallback);
23*344a7f5eSAndroid Build Coastguard Worker    method public int scheduleBackgroundDexoptJob();
24*344a7f5eSAndroid Build Coastguard Worker    method public void setBatchDexoptStartCallback(@NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.BatchDexoptStartCallback);
25*344a7f5eSAndroid Build Coastguard Worker    method public void setScheduleBackgroundDexoptJobCallback(@NonNull java.util.concurrent.Executor, @NonNull com.android.server.art.ArtManagerLocal.ScheduleBackgroundDexoptJobCallback);
26*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public android.os.ParcelFileDescriptor snapshotAppProfile(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @Nullable String) throws com.android.server.art.ArtManagerLocal.SnapshotProfileException;
27*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public android.os.ParcelFileDescriptor snapshotBootImageProfile(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot) throws com.android.server.art.ArtManagerLocal.SnapshotProfileException;
28*344a7f5eSAndroid Build Coastguard Worker    method public void startBackgroundDexoptJob();
29*344a7f5eSAndroid Build Coastguard Worker    method public void unscheduleBackgroundDexoptJob();
30*344a7f5eSAndroid Build Coastguard Worker  }
31*344a7f5eSAndroid Build Coastguard Worker
32*344a7f5eSAndroid Build Coastguard Worker  public static interface ArtManagerLocal.BatchDexoptStartCallback {
33*344a7f5eSAndroid Build Coastguard Worker    method public void onBatchDexoptStart(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull java.util.List<java.lang.String>, @NonNull com.android.server.art.model.BatchDexoptParams.Builder, @NonNull android.os.CancellationSignal);
34*344a7f5eSAndroid Build Coastguard Worker  }
35*344a7f5eSAndroid Build Coastguard Worker
36*344a7f5eSAndroid Build Coastguard Worker  public static interface ArtManagerLocal.DexoptDoneCallback {
37*344a7f5eSAndroid Build Coastguard Worker    method public void onDexoptDone(@NonNull com.android.server.art.model.DexoptResult);
38*344a7f5eSAndroid Build Coastguard Worker  }
39*344a7f5eSAndroid Build Coastguard Worker
40*344a7f5eSAndroid Build Coastguard Worker  public static interface ArtManagerLocal.ScheduleBackgroundDexoptJobCallback {
41*344a7f5eSAndroid Build Coastguard Worker    method public void onOverrideJobInfo(@NonNull android.app.job.JobInfo.Builder);
42*344a7f5eSAndroid Build Coastguard Worker  }
43*344a7f5eSAndroid Build Coastguard Worker
44*344a7f5eSAndroid Build Coastguard Worker  public static class ArtManagerLocal.SnapshotProfileException extends java.lang.Exception {
45*344a7f5eSAndroid Build Coastguard Worker  }
46*344a7f5eSAndroid Build Coastguard Worker
47*344a7f5eSAndroid Build Coastguard Worker  public class ArtModuleServiceInitializer {
48*344a7f5eSAndroid Build Coastguard Worker    method public static void setArtModuleServiceManager(@NonNull android.os.ArtModuleServiceManager);
49*344a7f5eSAndroid Build Coastguard Worker  }
50*344a7f5eSAndroid Build Coastguard Worker
51*344a7f5eSAndroid Build Coastguard Worker  public class DexUseManagerLocal {
52*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public static com.android.server.art.DexUseManagerLocal createInstance(@NonNull android.content.Context);
53*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public java.util.List<com.android.server.art.model.DexContainerFileUseInfo> getSecondaryDexContainerFileUseInfo(@NonNull String);
54*344a7f5eSAndroid Build Coastguard Worker    method public void notifyDexContainersLoaded(@NonNull com.android.server.pm.PackageManagerLocal.FilteredSnapshot, @NonNull String, @NonNull java.util.Map<java.lang.String,java.lang.String>);
55*344a7f5eSAndroid Build Coastguard Worker    method public void systemReady();
56*344a7f5eSAndroid Build Coastguard Worker  }
57*344a7f5eSAndroid Build Coastguard Worker
58*344a7f5eSAndroid Build Coastguard Worker  public class ReasonMapping {
59*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_BG_DEXOPT = "bg-dexopt";
60*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_BOOT_AFTER_MAINLINE_UPDATE = "boot-after-mainline-update";
61*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_BOOT_AFTER_OTA = "boot-after-ota";
62*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_CMDLINE = "cmdline";
63*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_FIRST_BOOT = "first-boot";
64*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INACTIVE = "inactive";
65*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL = "install";
66*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL_BULK = "install-bulk";
67*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL_BULK_DOWNGRADED = "install-bulk-downgraded";
68*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL_BULK_SECONDARY = "install-bulk-secondary";
69*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = "install-bulk-secondary-downgraded";
70*344a7f5eSAndroid Build Coastguard Worker    field public static final String REASON_INSTALL_FAST = "install-fast";
71*344a7f5eSAndroid Build Coastguard Worker  }
72*344a7f5eSAndroid Build Coastguard Worker
73*344a7f5eSAndroid Build Coastguard Worker}
74*344a7f5eSAndroid Build Coastguard Worker
75*344a7f5eSAndroid Build Coastguard Workerpackage com.android.server.art.model {
76*344a7f5eSAndroid Build Coastguard Worker
77*344a7f5eSAndroid Build Coastguard Worker  public class ArtFlags {
78*344a7f5eSAndroid Build Coastguard Worker    method public static int defaultGetStatusFlags();
79*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_FORCE = 16; // 0x10
80*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_FOR_PRIMARY_DEX = 1; // 0x1
81*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_FOR_SECONDARY_DEX = 2; // 0x2
82*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_FOR_SINGLE_SPLIT = 32; // 0x20
83*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_SHOULD_DOWNGRADE = 8; // 0x8
84*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_SHOULD_INCLUDE_DEPENDENCIES = 4; // 0x4
85*344a7f5eSAndroid Build Coastguard Worker    field public static final int FLAG_SKIP_IF_STORAGE_LOW = 64; // 0x40
86*344a7f5eSAndroid Build Coastguard Worker    field public static final int PRIORITY_BACKGROUND = 40; // 0x28
87*344a7f5eSAndroid Build Coastguard Worker    field public static final int PRIORITY_BOOT = 100; // 0x64
88*344a7f5eSAndroid Build Coastguard Worker    field public static final int PRIORITY_INTERACTIVE = 60; // 0x3c
89*344a7f5eSAndroid Build Coastguard Worker    field public static final int PRIORITY_INTERACTIVE_FAST = 80; // 0x50
90*344a7f5eSAndroid Build Coastguard Worker    field public static final int SCHEDULE_DISABLED_BY_SYSPROP = 2; // 0x2
91*344a7f5eSAndroid Build Coastguard Worker    field public static final int SCHEDULE_JOB_SCHEDULER_FAILURE = 1; // 0x1
92*344a7f5eSAndroid Build Coastguard Worker    field public static final int SCHEDULE_SUCCESS = 0; // 0x0
93*344a7f5eSAndroid Build Coastguard Worker  }
94*344a7f5eSAndroid Build Coastguard Worker
95*344a7f5eSAndroid Build Coastguard Worker  public abstract class BatchDexoptParams {
96*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract com.android.server.art.model.DexoptParams getDexoptParams();
97*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract java.util.List<java.lang.String> getPackages();
98*344a7f5eSAndroid Build Coastguard Worker  }
99*344a7f5eSAndroid Build Coastguard Worker
100*344a7f5eSAndroid Build Coastguard Worker  public static final class BatchDexoptParams.Builder {
101*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.BatchDexoptParams build();
102*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.BatchDexoptParams.Builder setDexoptParams(@NonNull com.android.server.art.model.DexoptParams);
103*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.BatchDexoptParams.Builder setPackages(@NonNull java.util.List<java.lang.String>);
104*344a7f5eSAndroid Build Coastguard Worker  }
105*344a7f5eSAndroid Build Coastguard Worker
106*344a7f5eSAndroid Build Coastguard Worker  public abstract class DeleteResult {
107*344a7f5eSAndroid Build Coastguard Worker    method public abstract long getFreedBytes();
108*344a7f5eSAndroid Build Coastguard Worker  }
109*344a7f5eSAndroid Build Coastguard Worker
110*344a7f5eSAndroid Build Coastguard Worker  public abstract class DexContainerFileUseInfo {
111*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getDexContainerFile();
112*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract java.util.Set<java.lang.String> getLoadingPackages();
113*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract android.os.UserHandle getUserHandle();
114*344a7f5eSAndroid Build Coastguard Worker  }
115*344a7f5eSAndroid Build Coastguard Worker
116*344a7f5eSAndroid Build Coastguard Worker  public class DexoptParams {
117*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public String getCompilerFilter();
118*344a7f5eSAndroid Build Coastguard Worker    method public int getFlags();
119*344a7f5eSAndroid Build Coastguard Worker    method public int getPriorityClass();
120*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public String getReason();
121*344a7f5eSAndroid Build Coastguard Worker    method @Nullable public String getSplitName();
122*344a7f5eSAndroid Build Coastguard Worker    field public static final String COMPILER_FILTER_NOOP = "skip";
123*344a7f5eSAndroid Build Coastguard Worker  }
124*344a7f5eSAndroid Build Coastguard Worker
125*344a7f5eSAndroid Build Coastguard Worker  public static final class DexoptParams.Builder {
126*344a7f5eSAndroid Build Coastguard Worker    ctor public DexoptParams.Builder(@NonNull String);
127*344a7f5eSAndroid Build Coastguard Worker    ctor public DexoptParams.Builder(@NonNull String, int);
128*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams build();
129*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams.Builder setCompilerFilter(@NonNull String);
130*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams.Builder setFlags(int);
131*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams.Builder setFlags(int, int);
132*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams.Builder setPriorityClass(int);
133*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public com.android.server.art.model.DexoptParams.Builder setSplitName(@Nullable String);
134*344a7f5eSAndroid Build Coastguard Worker  }
135*344a7f5eSAndroid Build Coastguard Worker
136*344a7f5eSAndroid Build Coastguard Worker  public abstract class DexoptResult {
137*344a7f5eSAndroid Build Coastguard Worker    method public int getFinalStatus();
138*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract java.util.List<com.android.server.art.model.DexoptResult.PackageDexoptResult> getPackageDexoptResults();
139*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getReason();
140*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getRequestedCompilerFilter();
141*344a7f5eSAndroid Build Coastguard Worker    field public static final int DEXOPT_CANCELLED = 40; // 0x28
142*344a7f5eSAndroid Build Coastguard Worker    field public static final int DEXOPT_FAILED = 30; // 0x1e
143*344a7f5eSAndroid Build Coastguard Worker    field public static final int DEXOPT_PERFORMED = 20; // 0x14
144*344a7f5eSAndroid Build Coastguard Worker    field public static final int DEXOPT_SKIPPED = 10; // 0xa
145*344a7f5eSAndroid Build Coastguard Worker  }
146*344a7f5eSAndroid Build Coastguard Worker
147*344a7f5eSAndroid Build Coastguard Worker  public abstract static class DexoptResult.DexContainerFileDexoptResult {
148*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getAbi();
149*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getActualCompilerFilter();
150*344a7f5eSAndroid Build Coastguard Worker    method public abstract long getDex2oatCpuTimeMillis();
151*344a7f5eSAndroid Build Coastguard Worker    method public abstract long getDex2oatWallTimeMillis();
152*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getDexContainerFile();
153*344a7f5eSAndroid Build Coastguard Worker    method public abstract long getSizeBeforeBytes();
154*344a7f5eSAndroid Build Coastguard Worker    method public abstract long getSizeBytes();
155*344a7f5eSAndroid Build Coastguard Worker    method public abstract int getStatus();
156*344a7f5eSAndroid Build Coastguard Worker    method public abstract boolean isPrimaryAbi();
157*344a7f5eSAndroid Build Coastguard Worker  }
158*344a7f5eSAndroid Build Coastguard Worker
159*344a7f5eSAndroid Build Coastguard Worker  public abstract static class DexoptResult.PackageDexoptResult {
160*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract java.util.List<com.android.server.art.model.DexoptResult.DexContainerFileDexoptResult> getDexContainerFileDexoptResults();
161*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getPackageName();
162*344a7f5eSAndroid Build Coastguard Worker    method public int getStatus();
163*344a7f5eSAndroid Build Coastguard Worker    method public boolean hasUpdatedArtifacts();
164*344a7f5eSAndroid Build Coastguard Worker  }
165*344a7f5eSAndroid Build Coastguard Worker
166*344a7f5eSAndroid Build Coastguard Worker  public abstract class DexoptStatus {
167*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract java.util.List<com.android.server.art.model.DexoptStatus.DexContainerFileDexoptStatus> getDexContainerFileDexoptStatuses();
168*344a7f5eSAndroid Build Coastguard Worker  }
169*344a7f5eSAndroid Build Coastguard Worker
170*344a7f5eSAndroid Build Coastguard Worker  public abstract static class DexoptStatus.DexContainerFileDexoptStatus {
171*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getAbi();
172*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getCompilationReason();
173*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getCompilerFilter();
174*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getDexContainerFile();
175*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public abstract String getLocationDebugString();
176*344a7f5eSAndroid Build Coastguard Worker    method public abstract boolean isPrimaryAbi();
177*344a7f5eSAndroid Build Coastguard Worker    method public abstract boolean isPrimaryDex();
178*344a7f5eSAndroid Build Coastguard Worker  }
179*344a7f5eSAndroid Build Coastguard Worker
180*344a7f5eSAndroid Build Coastguard Worker  public abstract class OperationProgress {
181*344a7f5eSAndroid Build Coastguard Worker    method public int getPercentage();
182*344a7f5eSAndroid Build Coastguard Worker  }
183*344a7f5eSAndroid Build Coastguard Worker
184*344a7f5eSAndroid Build Coastguard Worker}
185*344a7f5eSAndroid Build Coastguard Worker
186