Remove stale temporary ASEC containers

When a temporary container is created, its existence should be
ephemeral. However, if there is an error that causes system_server to be
killed during the process of creating a finalized ASEC, delete the stale
containers on the next start-up of system_server.

Change-Id: I7be8f94638a824295474c9a95960594848cb726b
This commit is contained in:
Kenny Root
2010-07-28 14:47:01 -07:00
parent 56c02dc3d3
commit f369a9b5f7

View File

@ -9787,10 +9787,15 @@ class PackageManagerService extends IPackageManager.Stub {
if (doGc) {
Runtime.getRuntime().gc();
}
// List stale containers.
// List stale containers and destroy stale temporary containers.
if (removeCids != null) {
for (String cid : removeCids) {
Log.w(TAG, "Container " + cid + " is stale");
if (cid.startsWith(mTempContainerPrefix)) {
Log.i(TAG, "Destroying stale temporary container " + cid);
PackageHelper.destroySdDir(cid);
} else {
Log.w(TAG, "Container " + cid + " is stale");
}
}
}
}