| 1 |
/* |
| 2 |
* Copyright (C) 2022 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 |
|
| 17 |
package com.android.server.art; |
| 18 |
|
| 19 |
/** |
| 20 |
* Represents the path to a profile file. |
| 21 |
* |
| 22 |
* @hide |
| 23 |
*/ |
| 24 |
union ProfilePath { |
| 25 |
PrimaryRefProfilePath primaryRefProfilePath; |
| 26 |
PrebuiltProfilePath prebuiltProfilePath; |
| 27 |
PrimaryCurProfilePath primaryCurProfilePath; |
| 28 |
SecondaryRefProfilePath secondaryRefProfilePath; |
| 29 |
SecondaryCurProfilePath secondaryCurProfilePath; |
| 30 |
TmpProfilePath tmpProfilePath; |
| 31 |
|
| 32 |
/** Represents a profile in the dex metadata file. */ |
| 33 |
com.android.server.art.DexMetadataPath dexMetadataPath; |
| 34 |
|
| 35 |
/** Represents a reference profile. */ |
| 36 |
parcelable PrimaryRefProfilePath { |
| 37 |
/** The name of the package. */ |
| 38 |
@utf8InCpp String packageName; |
| 39 |
/** The stem of the profile file */ |
| 40 |
@utf8InCpp String profileName; |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Represents a profile next to a dex file. This is usually a prebuilt profile in the system |
| 45 |
* image, but it can also be a profile that package manager can potentially put along with the |
| 46 |
* APK during installation. The latter one is not officially supported by package manager, but |
| 47 |
* OEMs can customize package manager to support that. |
| 48 |
*/ |
| 49 |
parcelable PrebuiltProfilePath { |
| 50 |
/** The path to the dex file that the profile is next to. */ |
| 51 |
@utf8InCpp String dexPath; |
| 52 |
} |
| 53 |
|
| 54 |
/** Represents a current profile. */ |
| 55 |
parcelable PrimaryCurProfilePath { |
| 56 |
/** The user ID of the user that owns the profile. */ |
| 57 |
int userId; |
| 58 |
/** The name of the package. */ |
| 59 |
@utf8InCpp String packageName; |
| 60 |
/** The stem of the profile file */ |
| 61 |
@utf8InCpp String profileName; |
| 62 |
} |
| 63 |
|
| 64 |
/** Represents a reference profile of a secondary dex file. */ |
| 65 |
parcelable SecondaryRefProfilePath { |
| 66 |
/** |
| 67 |
* The path to the dex file that the profile is next to. |
| 68 |
* |
| 69 |
* Currently, possible paths are in the format of |
| 70 |
* `{/data,/mnt/expand/<volume-uuid>}/{user,user_de}/<user-id>/<package-name>/...`. |
| 71 |
*/ |
| 72 |
@utf8InCpp String dexPath; |
| 73 |
} |
| 74 |
|
| 75 |
/** Represents a current profile of a secondary dex file. */ |
| 76 |
parcelable SecondaryCurProfilePath { |
| 77 |
/** The path to the dex file that the profile is next to. */ |
| 78 |
@utf8InCpp String dexPath; |
| 79 |
} |
| 80 |
|
| 81 |
/** All types of profile paths that artd can write to. */ |
| 82 |
union WritableProfilePath { |
| 83 |
PrimaryRefProfilePath forPrimary; |
| 84 |
SecondaryRefProfilePath forSecondary; |
| 85 |
} |
| 86 |
|
| 87 |
/** Represents a temporary profile. */ |
| 88 |
parcelable TmpProfilePath { |
| 89 |
/** The path that this temporary file will eventually be committed to. */ |
| 90 |
WritableProfilePath finalPath; |
| 91 |
/** A unique identifier to distinguish this temporary file from others. Filled by artd. */ |
| 92 |
@utf8InCpp String id; |
| 93 |
/** The path to the temporary file. Filled by artd. */ |
| 94 |
@utf8InCpp String tmpPath; |
| 95 |
} |
| 96 |
} |