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

Commit c5533865 authored by wangmingming1's avatar wangmingming1 Committed by android-build-merger
Browse files

Merge "Prevent system app upgrading from multi-arch to single-arch" am: 5cac6ed0 am: 58a08098

am: 791507db

Change-Id: I3e0605d8d6e9dcc6ecc68bb7af58afc3ee8f7b33
parents da694a50 791507db
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -15493,6 +15493,15 @@ public class PackageManagerService extends IPackageManager.Stub
                return;
                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
            // In case of rollback, remember per-user/profile install state
            allUsers = sUserManager.getUserIds();
            allUsers = sUserManager.getUserIds();
            installedUsers = ps.queryInstalledUsers(allUsers, true);
            installedUsers = ps.queryInstalledUsers(allUsers, true);