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

Commit e97261e1 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Pass down apex image if profilebootimage is enabled

Do this so that recompiled apps will use the right image.

Bug: 139883463
Test: manual
Change-Id: I3622e87a0759a0d5137da38c6f7f4a1c88e6a1e4
parent e98cb32b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -303,6 +303,9 @@ static const char* ENABLE_APEX_IMAGE = "enable_apex_image";
// Location of the apex image.
static const char* kApexImage = "/system/framework/apex.art";

// Phenotype property name for enabling profiling the boot class path.
static const char* PROFILE_BOOT_CLASS_PATH = "profilebootclasspath";

class RunDex2Oat : public ExecVHelper {
  public:
    RunDex2Oat(int zip_fd,
@@ -402,7 +405,15 @@ class RunDex2Oat : public ExecVHelper {
            server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
                                                                 ENABLE_APEX_IMAGE,
                                                                 /*default_value=*/ "");
        if (use_apex_image == "true") {

        std::string profile_boot_class_path = GetProperty("dalvik.vm.profilebootclasspath", "");
        profile_boot_class_path =
            server_configurable_flags::GetServerConfigurableFlag(
                RUNTIME_NATIVE_BOOT_NAMESPACE,
                PROFILE_BOOT_CLASS_PATH,
                /*default_value=*/ profile_boot_class_path);

        if (use_apex_image == "true" || profile_boot_class_path == "true") {
          boot_image = StringPrintf("-Ximage:%s", kApexImage);
        } else {
          boot_image = MapPropertyToArg("dalvik.vm.boot-image", "-Ximage:%s");