blob: 6abfdbab6e2682f5517624f03b710fd60cd576a9 [file] [log] [blame]
Calin Juravle45f8b292017-11-07 18:49:43 -08001/*
2** Copyright 2017, The Android Open Source Project
3**
4** Licensed under the Apache License, Version 2.0 (the "License");
5** you may not use this file except in compliance with the License.
6** You may obtain a copy of the License at
7**
8** http://www.apache.org/licenses/LICENSE-2.0
9**
10** Unless required by applicable law or agreed to in writing, software
11** distributed under the License is distributed on an "AS IS" BASIS,
12** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13** See the License for the specific language governing permissions and
14** limitations under the License.
15*/
16
17package android.content.pm.dex;
18
19import android.content.pm.dex.ISnapshotRuntimeProfileCallback;
20
21/**
22 * A system service that provides access to runtime and compiler artifacts.
23 *
24 * @hide
25 */
26interface IArtManager {
27 /**
Calin Juravlefcbb74a2018-01-21 21:39:18 -080028 * Snapshots a runtime profile according to the {@code profileType} parameter.
Calin Juravle45f8b292017-11-07 18:49:43 -080029 *
Calin Juravlefcbb74a2018-01-21 21:39:18 -080030 * If {@code profileType} is {@link ArtManager#PROFILE_APPS} the method will snapshot
31 * the profile for for an apk belonging to the package {@code packageName}.
32 * The apk is identified by {@code codePath}.
33 *
34 * If {@code profileType} is {@code ArtManager.PROFILE_BOOT_IMAGE} the method will snapshot
35 * the profile for the boot image. In this case {@code codePath can be null}. The parameters
36 * {@code packageName} and {@code codePath} are ignored.
Calin Juravle45f8b292017-11-07 18:49:43 -080037 *
38 * The calling process must have {@code android.permission.READ_RUNTIME_PROFILE} permission.
Calin Juravlefcbb74a2018-01-21 21:39:18 -080039 *
40 * The result will be posted on the {@code executor} using the given {@code callback}.
41 * The profile will be available as a read-only {@link android.os.ParcelFileDescriptor}.
42 *
43 * This method will throw {@link IllegalStateException} if
44 * {@link ArtManager#isRuntimeProfilingEnabled(int)} does not return true for the given
45 * {@code profileType}.
Calin Juravle45f8b292017-11-07 18:49:43 -080046 */
Calin Juravlefcbb74a2018-01-21 21:39:18 -080047 oneway void snapshotRuntimeProfile(int profileType, in String packageName,
48 in String codePath, in ISnapshotRuntimeProfileCallback callback);
49
50 /**
51 * Returns true if runtime profiles are enabled for the given type, false otherwise.
52 * The type can be can be either {@code ArtManager.PROFILE_APPS}
53 * or {@code ArtManager.PROFILE_BOOT_IMAGE}.
54 *
55 * @param profileType
56 */
57 boolean isRuntimeProfilingEnabled(int profileType);
Calin Juravle45f8b292017-11-07 18:49:43 -080058}