Merge "Fixed upgrading from forward-lock application to system application"

This commit is contained in:
Christopher Tate
2014-02-27 22:01:28 +00:00
committed by Gerrit Code Review

View File

@ -3674,6 +3674,7 @@ public class PackageManagerService extends IPackageManager.Stub {
updatedPkg = mSettings.getDisabledSystemPkgLPr(ps != null ? ps.name : pkg.packageName);
if (DEBUG_INSTALL && updatedPkg != null) Slog.d(TAG, "updatedPkg = " + updatedPkg);
}
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 (ps != null && !ps.codePath.equals(scanFile)) {
@ -3728,6 +3729,7 @@ public class PackageManagerService extends IPackageManager.Stub {
synchronized (mPackages) {
mSettings.enableSystemPackageLPw(ps.name);
}
updatedPkgBetter = true;
}
}
}
@ -3804,7 +3806,7 @@ public class PackageManagerService extends IPackageManager.Stub {
String codePath = null;
String resPath = null;
if ((parseFlags & PackageParser.PARSE_FORWARD_LOCK) != 0) {
if ((parseFlags & PackageParser.PARSE_FORWARD_LOCK) != 0 && !updatedPkgBetter) {
if (ps != null && ps.resourcePathString != null) {
resPath = ps.resourcePathString;
} else {