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

Commit f4c4b235 authored by Brice Jaglin's avatar Brice Jaglin Committed by Steve Kondik
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 477127e7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3721,6 +3721,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)) {
@@ -3775,6 +3776,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                    synchronized (mPackages) {
                        mSettings.enableSystemPackageLPw(ps.name);
                    }
                    updatedPkgBetter = true;
                }
            }
        }
@@ -3851,7 +3853,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 {