From da4eeabf867bf03e8ce8e40e5b33f9b820f66bc5 Mon Sep 17 00:00:00 2001 From: Mohammad Samiul Islam Date: Tue, 26 Nov 2019 11:31:48 +0000 Subject: [PATCH] Allow staging multiple sessions with non-overlapping packages (apk+apex) CL contains changes made in PackageManager world to allow staging multiple apexes on apexd. Bug: 141843321 Test: atest StagedInstallTest#testInstallMultipleStagedSession_ApexOnly Test: atest StagedInstallTest#testInstallMultipleStagedSession_PartialAbandon_ApexOnly Change-Id: Ic7fbdddf30047cafb712a102556b70c6dab271b1 --- .../com/android/server/pm/StagingManager.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/services/core/java/com/android/server/pm/StagingManager.java b/services/core/java/com/android/server/pm/StagingManager.java index 845f06d1ce5f8..e8d10a3216d47 100644 --- a/services/core/java/com/android/server/pm/StagingManager.java +++ b/services/core/java/com/android/server/pm/StagingManager.java @@ -620,32 +620,6 @@ public class StagingManager { PackageManager.INSTALL_FAILED_OTHER_STAGED_SESSION_IN_PROGRESS, "Cannot stage multiple sessions without checkpoint support", null); } - - // TODO:b/141843321 Add support for staging multiple sessions in apexd - // Since apexd doesn't support multiple staged sessions yet, we have to careful how - // we handle apex sessions. We want to allow a set of apex sessions under the same - // parent to be staged when there is no previously staged apex sessions. - if (isApexSession(session) && isApexSession(stagedSession)) { - // session is apex and it can co-exist with stagedSession only if they are from - // same parent - final boolean coExist; - if (!session.hasParentSessionId() && !stagedSession.hasParentSessionId()) { - // Both single package apex sessions. Cannot co-exist. - coExist = false; - } else { - // At least one of the session has parent. Both must be from same parent. - coExist = - session.getParentSessionId() == stagedSession.getParentSessionId(); - } - if (!coExist) { - throw new PackageManagerException( - PackageManager.INSTALL_FAILED_OTHER_STAGED_SESSION_IN_PROGRESS, - "Package: " + session.getPackageName() + " in session: " - + session.sessionId + " cannot be staged as there is " - + "already another apex staged session: " - + stagedSession.sessionId, null); - } - } } } }