summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-10-25 13:27:34 -0700
committer android-build-merger <android-build-merger@google.com> 2019-10-25 13:27:34 -0700
commite4bc16c48955dad9dff0e733ecec2c5bd9f7e733 (patch)
tree5efcb9bd3af6d69732ae08173cf6df25f88962f3
parentc5d074d889342888340ca70e9da76128ece7d3d9 (diff)
parentfca111db2fcdc93bf5acd17ce23bfde10570abe7 (diff)
Merge "Avoid preloading classes for boot image profiling" am: cfee28589b am: 84f358f9bf am: ac60bbb740
am: fca111db2f Change-Id: Ic28857abef951581a7627e3805ccd3db49c03391
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 363e5498f87c..865ec27e00c4 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -254,6 +254,18 @@ public class ZygoteInit {
InputStream is;
try {
+ // If we are profiling the boot image, avoid preloading classes.
+ // Can't use device_config since we are the zygote.
+ String prop = SystemProperties.get(
+ "persist.device_config.runtime_native_boot.profilebootclasspath", "");
+ // Might be empty if the property is unset since the default is "".
+ if (prop.length() == 0) {
+ prop = SystemProperties.get("dalvik.vm.profilebootclasspath", "");
+ }
+ if ("true".equals(prop)) {
+ return;
+ }
+
is = new FileInputStream(PRELOADED_CLASSES);
} catch (FileNotFoundException e) {
Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + ".");