Merge "Merge "Prevent system reset staged installer bypass flag unexpactly" into rvc-dev am: 809bf93563 am: d03b501796 am: 6a0ff25f9a" into rvc-qpr-dev-plus-aosp

This commit is contained in:
Automerger Merge Worker
2020-07-09 17:09:08 +00:00
committed by Android (Google) Code Review

View File

@@ -589,12 +589,12 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
}
}
if (mBypassNextStagedInstallerCheck) {
mBypassNextStagedInstallerCheck = false;
} else if (params.isStaged
&& !isCalledBySystemOrShell(callingUid)
&& !isWhitelistedStagedInstaller(requestedInstallerPackageName)) {
throw new SecurityException("Installer not allowed to commit staged install");
if (params.isStaged && !isCalledBySystemOrShell(callingUid)) {
if (mBypassNextStagedInstallerCheck) {
mBypassNextStagedInstallerCheck = false;
} else if (!isStagedInstallerAllowed(requestedInstallerPackageName)) {
throw new SecurityException("Installer not allowed to commit staged install");
}
}
if (!params.isMultiPackage) {
@@ -725,7 +725,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
|| callingUid == Process.SHELL_UID;
}
private boolean isWhitelistedStagedInstaller(String installerName) {
private boolean isStagedInstallerAllowed(String installerName) {
return SystemConfig.getInstance().getWhitelistedStagedInstallers().contains(installerName);
}