Loading services/core/java/com/android/server/pm/PackageManagerService.java +11 −7 Original line number Diff line number Diff line Loading @@ -4225,6 +4225,14 @@ public class PackageManagerService extends IPackageManager.Stub { boolean updatedPkgBetter = false; // First check if this is a system package that may involve an update if (updatedPkg != null && (parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0) { // If new package is not located in "/system/priv-app" (e.g. due to an OTA), // it needs to drop FLAG_PRIVILEGED. if (locationIsPrivileged(scanFile)) { updatedPkg.pkgFlags |= ApplicationInfo.FLAG_PRIVILEGED; } else { updatedPkg.pkgFlags &= ~ApplicationInfo.FLAG_PRIVILEGED; } if (ps != null && !ps.codePath.equals(scanFile)) { // The path has changed from what was last scanned... check the // version of the new path against what we have stored to determine Loading @@ -4244,12 +4252,6 @@ public class PackageManagerService extends IPackageManager.Stub { updatedPkg.codePathString = scanFile.toString(); updatedPkg.resourcePath = scanFile; updatedPkg.resourcePathString = scanFile.toString(); // This is the point at which we know that the system-disk APK // for this package has moved during a reboot (e.g. due to an OTA), // so we need to reevaluate it for privilege policy. if (locationIsPrivileged(scanFile)) { updatedPkg.pkgFlags |= ApplicationInfo.FLAG_PRIVILEGED; } } updatedPkg.pkg = pkg; throw new PackageManagerException(INSTALL_FAILED_DUPLICATE_PACKAGE, null); Loading Loading @@ -7105,7 +7107,9 @@ public class PackageManagerService extends IPackageManager.Stub { // If the original was granted this permission, we take // that grant decision as read and propagate it to the // update. if (sysPs.isPrivileged()) { allowed = true; } } else { // The system apk may have been updated with an older // version of the one on the data partition, but which Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +11 −7 Original line number Diff line number Diff line Loading @@ -4225,6 +4225,14 @@ public class PackageManagerService extends IPackageManager.Stub { boolean updatedPkgBetter = false; // First check if this is a system package that may involve an update if (updatedPkg != null && (parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0) { // If new package is not located in "/system/priv-app" (e.g. due to an OTA), // it needs to drop FLAG_PRIVILEGED. if (locationIsPrivileged(scanFile)) { updatedPkg.pkgFlags |= ApplicationInfo.FLAG_PRIVILEGED; } else { updatedPkg.pkgFlags &= ~ApplicationInfo.FLAG_PRIVILEGED; } if (ps != null && !ps.codePath.equals(scanFile)) { // The path has changed from what was last scanned... check the // version of the new path against what we have stored to determine Loading @@ -4244,12 +4252,6 @@ public class PackageManagerService extends IPackageManager.Stub { updatedPkg.codePathString = scanFile.toString(); updatedPkg.resourcePath = scanFile; updatedPkg.resourcePathString = scanFile.toString(); // This is the point at which we know that the system-disk APK // for this package has moved during a reboot (e.g. due to an OTA), // so we need to reevaluate it for privilege policy. if (locationIsPrivileged(scanFile)) { updatedPkg.pkgFlags |= ApplicationInfo.FLAG_PRIVILEGED; } } updatedPkg.pkg = pkg; throw new PackageManagerException(INSTALL_FAILED_DUPLICATE_PACKAGE, null); Loading Loading @@ -7105,7 +7107,9 @@ public class PackageManagerService extends IPackageManager.Stub { // If the original was granted this permission, we take // that grant decision as read and propagate it to the // update. if (sysPs.isPrivileged()) { allowed = true; } } else { // The system apk may have been updated with an older // version of the one on the data partition, but which Loading