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

Commit 7f5a695b authored by Dario Freni's avatar Dario Freni
Browse files

Preserve active staged sessions.

If a staged session is pending, we should never garbage collect it.
Leave it to the installer to abandon the session if needed.

This is a partial revert of Ifaccf50e744a97e30a4fda0e47b88d7dc71adcf8.
In reality, this logic was correctly preserving non-final staged
sessions, and it was the condition in sealAndValidateIfNecessary that
previously caused the erroneous early garbage collection of staged
sessions in final state.

Fix: 132444450
Bug: 132444450
Test: staged a session, manually modified update timestamp, verified
that it's correctly applied on reboot. manually modified update
timestamp again, verified that it's correctly garbage collected.

Change-Id: I5fc568357fb8ec483d52056f5a805b09149cfec9
parent 41b8270f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -363,7 +363,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
                                System.currentTimeMillis() - session.getUpdatedMillis();
                        final boolean valid;
                        if (session.isStaged()) {
                            if (timeSinceUpdate >= MAX_TIME_SINCE_UPDATE_MILLIS) {
                            if (timeSinceUpdate >= MAX_TIME_SINCE_UPDATE_MILLIS
                                    && session.isStagedAndInTerminalState()) {
                                valid = false;
                            } else {
                                valid = true;