diff options
| author | 2019-01-22 08:57:20 +0000 | |
|---|---|---|
| committer | 2019-01-22 08:57:20 +0000 | |
| commit | 24c15d23312afff4159f882db53fefeb02a6c5d5 (patch) | |
| tree | d41695ab5084d928bdf71bee00a5268012e38fa0 | |
| parent | 39adac52d04b6ea4812eef9f82844448ad73c2b4 (diff) | |
| parent | acd7db8c7b61f0dd828a55785178fe14a4430911 (diff) | |
Merge "Fake out ApplicationInfo for APEXs."
| -rw-r--r-- | core/java/android/content/pm/PackageParser.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index a185c8a60f9b..88a240f240cd 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -8494,6 +8494,18 @@ public class PackageParser { public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts) throws PackageParserException { PackageInfo pi = new PackageInfo(); + + // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest + // Add ApplicationInfo to the PackageInfo. + ApplicationInfo ai = new ApplicationInfo(); + ai.sourceDir = apexFile.getPath(); + ai.flags = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_INSTALLED; + ai.enabled = true; + ai.targetSdkVersion = 28; + ai.targetSandboxVersion = 0; + pi.applicationInfo = ai; + + // TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time // we want to generate information for APEX modules. PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile, |