Merge "Unset INSTALL_DISABLE_VERIFICATION flag if install is not from system" into qt-dev

am: b739b582ad

Change-Id: I14bc50edcee6bcfe5b8979f0186b37486f2eff3f
This commit is contained in:
Nikita Ioffe
2019-08-29 15:09:33 -07:00
committed by android-build-merger

View File

@@ -505,6 +505,11 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
params.installFlags &= ~PackageManager.INSTALL_REQUEST_DOWNGRADE;
}
if (callingUid != Process.SYSTEM_UID) {
// Only system_server can use INSTALL_DISABLE_VERIFICATION.
params.installFlags &= ~PackageManager.INSTALL_DISABLE_VERIFICATION;
}
boolean isApex = (params.installFlags & PackageManager.INSTALL_APEX) != 0;
if (params.isStaged || isApex) {
mContext.enforceCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGES, TAG);