Merge "Propagate ephemeral flag from adb install to PackageParser"

This commit is contained in:
TreeHugger Robot
2017-01-04 15:42:30 +00:00
committed by Android (Google) Code Review

View File

@@ -703,8 +703,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
for (File addedFile : addedFiles) {
final ApkLite apk;
try {
apk = PackageParser.parseApkLite(
addedFile, PackageParser.PARSE_COLLECT_CERTIFICATES);
int flags = PackageParser.PARSE_COLLECT_CERTIFICATES;
if ((params.installFlags & PackageManager.INSTALL_EPHEMERAL) != 0) {
flags |= PackageParser.PARSE_IS_EPHEMERAL;
}
apk = PackageParser.parseApkLite(addedFile, flags);
} catch (PackageParserException e) {
throw PackageManagerException.from(e);
}