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

Commit 00816356 authored by Patrick Baumann's avatar Patrick Baumann Committed by android-build-merger
Browse files

Merge "Populate mPackages with system pkg even if installed is better" into pi-dev am: 28ea4548

am: 0e8a46e4

Change-Id: Idf8b18ec60d4eed489ebb9e5a909cbb1d1564f89
parents 8521aa2f 0e8a46e4
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -8815,8 +8815,16 @@ public class PackageManagerService extends IPackageManager.Stub
        if (scanSystemPartition && isSystemPkgUpdated && !isSystemPkgBetter) {
            // The version of the application on the /system partition is less than or
            // equal to the version on the /data partition. Throw an exception and use
            // the application already installed on the /data partition.
            // equal to the version on the /data partition. Even though the disabled system package
            // is likely to be replaced by a version on the /data partition, we make assumptions
            // that it's part of the mPackages collection during package manager initialization. So,
            // add it to mPackages if there isn't already a package in the collection and then throw
            // an exception to use the application already installed on the /data partition.
            synchronized (mPackages) {
                if (!mPackages.containsKey(pkg.packageName)) {
                    mPackages.put(pkg.packageName, pkg);
                }
            }
            throw new PackageManagerException(Log.WARN, "Package " + pkg.packageName + " at "
                    + pkg.codePath + " ignored: updated version " + pkgSetting.versionCode
                    + " better than this " + pkg.getLongVersionCode());