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

Commit e87fe0a1 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Installd: Check for dex2oatd before running it

Only select dex2oatd when it is actually available. Moves
a check to be a conditional.

Test: mmma frameworks/native/cmds/installd
Test: installd_dexopt_test
Change-Id: I4c5a8de68d0b4874632518733aeada22e1e6290c
parent 1636f41a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -308,11 +308,12 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd

    // If the runtime was requested to use libartd.so, we'll run dex2oatd, otherwise dex2oat.
    const char* dex2oat_bin = "/system/bin/dex2oat";
    static const char* kDex2oatDebugPath = "/system/bin/dex2oatd";
    constexpr const char* kDex2oatDebugPath = "/system/bin/dex2oatd";
    if (is_debug_runtime() || (background_job_compile && is_debuggable_build())) {
        DCHECK(access(kDex2oatDebugPath, X_OK) == 0);
        if (access(kDex2oatDebugPath, X_OK) == 0) {
            dex2oat_bin = kDex2oatDebugPath;
        }
    }

    bool generate_minidebug_info = kEnableMinidebugInfo &&
            android::base::GetBoolProperty(kMinidebugInfoSystemProperty,