Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f369a9b5 authored by Kenny Root's avatar Kenny Root
Browse files

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
parent 56c02dc3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -9787,13 +9787,18 @@ 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) {
               if (cid.startsWith(mTempContainerPrefix)) {
                   Log.i(TAG, "Destroying stale temporary container " + cid);
                   PackageHelper.destroySdDir(cid);
               } else {
                   Log.w(TAG, "Container " + cid + " is stale");
               }
           }
       }
   }

   /*
    * Utility method to unload a list of specified containers