From f369a9b5f7b2ae75875753caf90ec68fd9dbc144 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 28 Jul 2010 14:47:01 -0700 Subject: [PATCH] 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 --- .../java/com/android/server/PackageManagerService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 17ad9e38acaf8..1a4b59fa19685 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -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"); + } } } }