summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-02-26 15:26:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-02-26 15:26:17 +0000
commit2cb4a0538f9b7a88afa31935e1648c106b053e1f (patch)
tree7a882d4f2582424b37b9c72bc7abd08f6ad8b879
parent99ba11864462bb8b574dabc7bfd88ec837da23a1 (diff)
parentaaad21e29883cf4b5d63e87911cb6ebd0766d823 (diff)
Merge "Query the enable_apex_image flag from native experiment."
-rw-r--r--cmds/installd/Android.bp2
-rw-r--r--cmds/installd/dexopt.cpp19
-rw-r--r--cmds/installd/tests/Android.bp4
3 files changed, 24 insertions, 1 deletions
diff --git a/cmds/installd/Android.bp b/cmds/installd/Android.bp
index 9d3a234d76..c5a8f49069 100644
--- a/cmds/installd/Android.bp
+++ b/cmds/installd/Android.bp
@@ -34,6 +34,7 @@ cc_defaults {
"libprocessgroup",
"libselinux",
"libutils",
+ "server_configurable_flags",
],
product_variables: {
@@ -225,6 +226,7 @@ cc_binary {
"libprocessgroup",
"libselinux",
"libutils",
+ "server_configurable_flags",
],
}
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index acc06471b5..fa25c971d6 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -45,6 +45,7 @@
#include <private/android_filesystem_config.h>
#include <processgroup/sched_policy.h>
#include <selinux/android.h>
+#include <server_configurable_flags/get_flags.h>
#include <system/thread_defs.h>
#include "dexopt.h"
@@ -260,6 +261,13 @@ static std::string MapPropertyToArg(const std::string& property,
return "";
}
+// Namespace for Android Runtime flags applied during boot time.
+static const char* RUNTIME_NATIVE_BOOT_NAMESPACE = "runtime_native_boot";
+// Feature flag name for running the JIT in Zygote experiment, b/119800099.
+static const char* ENABLE_APEX_IMAGE = "enable_apex_image";
+// Location of the apex image.
+static const char* kApexImage = "/system/framework/apex.art";
+
class RunDex2Oat : public ExecVHelper {
public:
RunDex2Oat(int zip_fd,
@@ -352,7 +360,16 @@ class RunDex2Oat : public ExecVHelper {
bool generate_minidebug_info = kEnableMinidebugInfo &&
GetBoolProperty(kMinidebugInfoSystemProperty, kMinidebugInfoSystemPropertyDefault);
- std::string boot_image = MapPropertyToArg("dalvik.vm.boot-image", "-Ximage:%s");
+ std::string boot_image;
+ std::string use_apex_image =
+ server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
+ ENABLE_APEX_IMAGE,
+ /*default_value=*/ "");
+ if (use_apex_image == "true") {
+ boot_image = StringPrintf("-Ximage:%s", kApexImage);
+ } else {
+ boot_image = MapPropertyToArg("dalvik.vm.boot-image", "-Ximage:%s");
+ }
// clang FORTIFY doesn't let us use strlen in constant array bounds, so we
// use arraysize instead.
diff --git a/cmds/installd/tests/Android.bp b/cmds/installd/tests/Android.bp
index 9c9db0f21d..1ed49a0cfd 100644
--- a/cmds/installd/tests/Android.bp
+++ b/cmds/installd/tests/Android.bp
@@ -31,6 +31,7 @@ cc_test {
"libprocessgroup",
"libselinux",
"libutils",
+ "server_configurable_flags",
],
static_libs: [
"libdiskusage",
@@ -54,6 +55,7 @@ cc_test {
"libprocessgroup",
"libselinux",
"libutils",
+ "server_configurable_flags",
],
static_libs: [
"libdiskusage",
@@ -77,6 +79,7 @@ cc_test {
"libprocessgroup",
"libselinux",
"libutils",
+ "server_configurable_flags",
],
static_libs: [
"libdiskusage",
@@ -96,6 +99,7 @@ cc_test {
"libbase",
"libcutils",
"libutils",
+ "server_configurable_flags",
],
static_libs: [
"liblog",