summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-05-17 12:31:12 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-05-17 12:31:12 +0000
commit94b2981853f47de2e38494a0e78ef0af3ba39354 (patch)
tree0287e42a6c8bb56d7fa6f0f84f0d8a65224367c3
parent141e7b0395cabc8e6ff14a8158fead54722ff8e9 (diff)
parente66a2bf226943ac5f1a466551369c18fb66b348a (diff)
Merge "Workaround for USAP support in jitzygote." into qt-dev
-rw-r--r--core/java/android/os/ZygoteProcess.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index 2b170c2a6587..3ea3bbc959e8 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -640,14 +640,9 @@ public class ZygoteProcess {
ZygoteConfig.USAP_POOL_ENABLED, USAP_POOL_ENABLED_DEFAULT);
if (!propertyString.isEmpty()) {
- if (SystemProperties.get("dalvik.vm.boot-image", "").endsWith("apex.art")) {
- // TODO(b/119800099): Tweak usap configuration in jitzygote mode.
- mUsapPoolEnabled = false;
- } else {
- mUsapPoolEnabled = Zygote.getConfigurationPropertyBoolean(
- ZygoteConfig.USAP_POOL_ENABLED,
- Boolean.parseBoolean(USAP_POOL_ENABLED_DEFAULT));
- }
+ mUsapPoolEnabled = Zygote.getConfigurationPropertyBoolean(
+ ZygoteConfig.USAP_POOL_ENABLED,
+ Boolean.parseBoolean(USAP_POOL_ENABLED_DEFAULT));
}
boolean valueChanged = origVal != mUsapPoolEnabled;
@@ -665,6 +660,16 @@ public class ZygoteProcess {
private boolean fetchUsapPoolEnabledPropWithMinInterval() {
final long currentTimestamp = SystemClock.elapsedRealtime();
+ if (SystemProperties.get("dalvik.vm.boot-image", "").endsWith("apex.art")) {
+ // TODO(b/119800099): In jitzygote mode, we want to start using USAP processes
+ // only once the boot classpath has been compiled. There is currently no callback
+ // from the runtime to notify the zygote about end of compilation, so for now just
+ // arbitrarily start USAP processes 15 seconds after boot.
+ if (currentTimestamp <= 15000) {
+ return false;
+ }
+ }
+
if (mIsFirstPropCheck
|| (currentTimestamp - mLastPropCheckTimestamp >= Zygote.PROPERTY_CHECK_INTERVAL)) {
mIsFirstPropCheck = false;