Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cac6ed0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents a0a70be2 03b74909
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17225,6 +17225,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);