From 1ace5bc070b7271a3f5835b13e326875785f718c Mon Sep 17 00:00:00 2001 From: Suchi Amalapurapu Date: Thu, 13 May 2010 12:05:53 -0700 Subject: Fix 2672155 Check the code path when enabling disabling packages. Add unit test Change-Id: I0f0f482a3735234eab3f63ba1f6462574b70144e --- services/java/com/android/server/PackageManagerService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index b9204c7..ee725cc 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -5315,13 +5315,13 @@ class PackageManagerService extends IPackageManager.Stub { } SdInstallArgs(String cid) { - super(null, null, PackageManager.INSTALL_EXTERNAL, null); - this.cid = cid; + this((Uri)null, cid); } SdInstallArgs(Uri packageURI, String cid) { super(packageURI, null, PackageManager.INSTALL_EXTERNAL, null); this.cid = cid; + cachePath = PackageHelper.getSdDir(cid); } void createCopyFile() { @@ -9565,7 +9565,10 @@ class PackageManagerService extends IPackageManager.Stub { } if (DEBUG_SD_INSTALL) Log.i(TAG, "Looking for pkg : " + pkgName); PackageSetting ps = mSettings.mPackages.get(pkgName); - if (ps != null && ps.codePathString != null) { + // The package status is changed only if the code path + // matches between settings and the container id. + if (ps != null && ps.codePathString != null && + ps.codePathString.equals(args.getCodePath())) { if (DEBUG_SD_INSTALL) Log.i(TAG, "Container : " + cid + " corresponds to pkg : " + pkgName + " at code path: " + ps.codePathString); -- cgit v1.1