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

am: fdbc6edec2

Change-Id: I77aeb84e445e3e199b1b9d2bd37f8ffa5385e8ea
This commit is contained in:
Nikita Ioffe
2019-08-29 15:16:28 -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);