frameworks/base
修訂 | 868cee7672ab7186c0aaa51e871f82eeff143d7b (tree) |
---|---|
時間 | 2011-04-13 05:08:12 |
作者 | Kenny Root <kroot@goog...> |
Commiter | Kenny Root |
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: I429dfe1e4b592595865235e83b6055aa8c3126ae
@@ -9702,10 +9702,15 @@ class PackageManagerService extends IPackageManager.Stub { | ||
9702 | 9702 | if (doGc) { |
9703 | 9703 | Runtime.getRuntime().gc(); |
9704 | 9704 | } |
9705 | - // List stale containers. | |
9705 | + // List stale containers and destroy stale temporary containers. | |
9706 | 9706 | if (removeCids != null) { |
9707 | 9707 | for (String cid : removeCids) { |
9708 | - Log.w(TAG, "Container " + cid + " is stale"); | |
9708 | + if (cid.startsWith(mTempContainerPrefix)) { | |
9709 | + Log.i(TAG, "Destroying stale temporary container " + cid); | |
9710 | + PackageHelper.destroySdDir(cid); | |
9711 | + } else { | |
9712 | + Log.w(TAG, "Container " + cid + " is stale"); | |
9713 | + } | |
9709 | 9714 | } |
9710 | 9715 | } |
9711 | 9716 | } |