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

Commit bc50bdca authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am e259bc77: Fix issue #2558391: Package manager problem when not replacing...

am e259bc77: Fix issue #2558391: Package manager problem when not replacing existing system partition app

Merge commit 'e259bc77' into froyo-plus-aosp

* commit 'e259bc77':
  Fix issue #2558391: Package manager problem when not replacing existing system partition app
parents fa41ccf1 e259bc77
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -5464,6 +5464,17 @@ class PackageManagerService extends IPackageManager.Stub {
        boolean dataDirExists = getDataPathForPackage(pkg).exists();
        res.name = pkgName;
        synchronized(mPackages) {
            if (mSettings.mRenamedPackages.containsKey(pkgName)) {
                // A package with the same name is already installed, though
                // it has been renamed to an older name.  The package we
                // are trying to install should be installed as an update to
                // the existing one, but that has not been requested, so bail.
                Slog.w(TAG, "Attempt to re-install " + pkgName
                        + " without first uninstalling package running as "
                        + mSettings.mRenamedPackages.get(pkgName));
                res.returnCode = PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
                return;
            }
            if (mPackages.containsKey(pkgName) || mAppDirs.containsKey(pkg.mPath)) {
                // Don't allow installation over an existing package with the same name.
                Slog.w(TAG, "Attempt to re-install " + pkgName
@@ -5595,7 +5606,7 @@ class PackageManagerService extends IPackageManager.Stub {
                PackageInstalledInfo restoreRes = new PackageInstalledInfo();
                restoreRes.removedInfo = new PackageRemovedInfo();
                // Parse old package
                parseFlags |= ~PackageManager.INSTALL_REPLACE_EXISTING;
                parseFlags &= ~PackageManager.INSTALL_REPLACE_EXISTING;
                scanPackageLI(restoreFile, parseFlags, scanMode);
                synchronized (mPackages) {
                    updatePermissionsLP(deletedPackage.packageName, deletedPackage,