Reject a multi-sessin set as APEX (1/n)

Prevent the crash loop in b/163288861#comment1.

It doesn't make sense to set a multi-session to APEX at all.
We should check and reject this case.

Bug: 163288861
Test: N/A, will be added in next CL

Change-Id: I23147837a11733b776b1147797b545b539c6c05a
This commit is contained in:
JW Wang
2020-08-10 10:46:18 +08:00
parent 6ad4b33424
commit 271e922bb0

View File

@@ -613,6 +613,9 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
throw new IllegalArgumentException(
"APEX files can only be installed as part of a staged session.");
}
if (params.isMultiPackage) {
throw new IllegalArgumentException("A multi-session can't be set as APEX.");
}
}
if (params.isStaged && !isCalledBySystemOrShell(callingUid)) {