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

Commit 5c092f7e authored by Roland Levillain's avatar Roland Levillain Committed by android-build-merger
Browse files

Merge "Check that a Runtime APEX has been activated before running otapreopt."...

Merge "Check that a Runtime APEX has been activated before running otapreopt." am: 59234af3 am: d55a4272
am: 0c5bf694

Change-Id: Ibcc24d3edd74cade99a67846824b6a0692bbb180
parents 083d25eb 0c5bf694
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -236,6 +236,18 @@ static int otapreopt_chroot(const int argc, char **arg) {
    // the Android Runtime APEX, as it is required by otapreopt to run dex2oat.
    std::vector<apex::ApexFile> active_packages = ActivateApexPackages();

    // Check that an Android Runtime APEX has been activated; clean up and exit
    // early otherwise.
    if (std::none_of(active_packages.begin(),
                     active_packages.end(),
                     [](const apex::ApexFile& package){
                         return package.GetManifest().name() == "com.android.runtime";
                     })) {
        LOG(FATAL_WITHOUT_ABORT) << "No activated com.android.runtime APEX package.";
        DeactivateApexPackages(active_packages);
        exit(217);
    }

    // Now go on and run otapreopt.

    // Incoming:  cmd + status-fd + target-slot + cmd...      | Incoming | = argc