Merge "Prevent system app upgrading from multi-arch to single-arch"

am: 5cac6ed047

Change-Id: I0e7c6fbea14dcf401076994fa53b9ce66324bb4a
This commit is contained in:
wangmingming1
2017-12-02 03:06:41 +00:00
committed by android-build-merger

View File

@@ -17731,6 +17731,15 @@ public class PackageManagerService extends IPackageManager.Stub
return;
}
// check if the new package supports all of the abis which the old package supports
boolean oldPkgSupportMultiArch = oldPackage.applicationInfo.secondaryCpuAbi != null;
boolean newPkgSupportMultiArch = pkg.applicationInfo.secondaryCpuAbi != null;
if (isSystemApp(oldPackage) && oldPkgSupportMultiArch && !newPkgSupportMultiArch) {
res.setError(INSTALL_FAILED_UPDATE_INCOMPATIBLE,
"Update to package " + pkgName + " doesn't support multi arch");
return;
}
// In case of rollback, remember per-user/profile install state
allUsers = sUserManager.getUserIds();
installedUsers = ps.queryInstalledUsers(allUsers, true);