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

Commit cae4e463 authored by Jooyung Han's avatar Jooyung Han
Browse files

Make sure session.abandon() will abort apex session

In this change, two races are handled to make sure that apex session is
aborted correctly.

1. session.abandon() is called before marking it as ready.

PackageSessionVerifier will mark the session as "ready" after the
verification. Abandon() marks the session as "destroyed", marking it as
ready can fail, which results in failing to call either of
markStagedSessionReady() or abortStagedSession() of IApexService.

PackageSessionVerifier now throws an exception when it fails to mark the
session as ready so that the exception handler can ensure the active
session is aborted (calling abortStagedSession()).

2. session.abandon() is called just before dispatchPendingAbandonCallback()

The session (and its apex session) is marked "ready". However, the
sesion is not yet added to StagingManager. Hence, even though abandon()
calls StagingManager.abortCommitedSession(), StagingManager does
nothing because it doesn't know the session. (Not aborted)

In this change, StagingManager makes sure that the apex session is
aborted.

Note that these two races don't cause any severe problem now, but leave the
two session data (PM sessions and APEX sessions) out of sync. This
prevented adding check like ag/34097710.

Bug: 425478146
Flag: EXEMPT BUGFIX
Test: StagedInstallInternalTest, StagingManagerTest
Change-Id: Id41c6e493e3f5e4de78b3e9d240e6222182238eb
parent 07ebbee2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment