am bc50bdca: am e259bc77: Fix issue #2558391: Package manager problem when not replacing existing system partition app
Merge commit 'bc50bdca0ae1f7d173e4f589db250dc519740c16' into kraken * commit 'bc50bdca0ae1f7d173e4f589db250dc519740c16': Fix issue #2558391: Package manager problem when not replacing existing system partition app
This commit is contained in:
@@ -5488,6 +5488,17 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
boolean dataDirExists = getDataPathForPackage(pkg).exists();
|
boolean dataDirExists = getDataPathForPackage(pkg).exists();
|
||||||
res.name = pkgName;
|
res.name = pkgName;
|
||||||
synchronized(mPackages) {
|
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)) {
|
if (mPackages.containsKey(pkgName) || mAppDirs.containsKey(pkg.mPath)) {
|
||||||
// Don't allow installation over an existing package with the same name.
|
// Don't allow installation over an existing package with the same name.
|
||||||
Slog.w(TAG, "Attempt to re-install " + pkgName
|
Slog.w(TAG, "Attempt to re-install " + pkgName
|
||||||
@@ -5619,7 +5630,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
PackageInstalledInfo restoreRes = new PackageInstalledInfo();
|
PackageInstalledInfo restoreRes = new PackageInstalledInfo();
|
||||||
restoreRes.removedInfo = new PackageRemovedInfo();
|
restoreRes.removedInfo = new PackageRemovedInfo();
|
||||||
// Parse old package
|
// Parse old package
|
||||||
parseFlags |= ~PackageManager.INSTALL_REPLACE_EXISTING;
|
parseFlags &= ~PackageManager.INSTALL_REPLACE_EXISTING;
|
||||||
scanPackageLI(restoreFile, parseFlags, scanMode);
|
scanPackageLI(restoreFile, parseFlags, scanMode);
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
updatePermissionsLP(deletedPackage.packageName, deletedPackage,
|
updatePermissionsLP(deletedPackage.packageName, deletedPackage,
|
||||||
|
|||||||
Reference in New Issue
Block a user