Merge "Prevent system app upgrading from multi-arch to single-arch" am: 5cac6ed047 am: 58a0809802
am: 791507db22
Change-Id: I3e0605d8d6e9dcc6ecc68bb7af58afc3ee8f7b33
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index d0ad4ac..0c6be32 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -15493,6 +15493,15 @@
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);