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

Commit 64fcdf63 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Appropriately sets all installs on *any* failure of one

During multi-package install, this change ensures that all of the
install results have their reason set to a value besides
INSTALL_SUCCEEDED to avoid post install steps treating them as if they
were successfully installed.

Test: atest com.android.tests.atomicinstall.AtomicInstallTest#testEarlyFailureFailsAll
Fixes: 133380744
Change-Id: I60b5c5376a27979d3fa4dfb67914dbd3573e280b
parent 612f71b1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17071,6 +17071,13 @@ public class PackageManagerService extends IPackageManager.Stub
                        cleanUpAppIdCreation(result);
                    }
                }
                // TODO(patb): create a more descriptive reason than unknown in future release
                // mark all non-failure installs as UNKNOWN so we do not treat them as success
                for (InstallRequest request : requests) {
                    if (request.installResult.returnCode == PackageManager.INSTALL_SUCCEEDED) {
                        request.installResult.returnCode = PackageManager.INSTALL_UNKNOWN;
                    }
                }
            }
            for (PrepareResult result : prepareResults.values()) {
                if (result.freezer != null) {