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

Commit 8554a093 authored by Brice Jaglin's avatar Brice Jaglin Committed by Johan Redestig
Browse files

Fixed upgrading from forward-lock application to system application

Fixes the case when the app on system is newer than the
currently installed. Something that can happen e.g. after
a FOTA update.

Change-Id: I102e9cdd5693d5e66667c0c8989dc2643c72dd16
parent a14d9c31
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 {