summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2020-02-17 14:17:41 +0000
committer Calin Juravle <calin@google.com> 2020-02-17 14:17:41 +0000
commit9fd9baab38601c798b0c004ba8df49b3b50e16b5 (patch)
treee9696bc57021c4f13897b0e3d653b06043f8be8f
parent5905f9ffaf08b45ec7312c0cba1303a86acb9176 (diff)
parent2d5242b6805b1db4122d3ed9ee7b5064f5d1146f (diff)
Merge "Pass system server class loader context when asking GetDexOptNeeded" am: d42527b844 am: 7d3380d672 am: 2d5242b680
Change-Id: Ib59bf9c16f7f13a1cbf7cce48e9b56f77364f073
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index e34aa9722ec2..a47bd17f45af 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -653,17 +653,18 @@ public class ZygoteInit {
String classPathForElement = "";
boolean compiledSomething = false;
for (String classPathElement : classPathElements) {
- // System server is fully AOTed and never profiled
- // for profile guided compilation.
+ // We default to the verify filter because the compilation will happen on /data and
+ // system server cannot load executable code outside /system.
String systemServerFilter = SystemProperties.get(
- "dalvik.vm.systemservercompilerfilter", "speed");
+ "dalvik.vm.systemservercompilerfilter", "verify");
+ String classLoaderContext =
+ getSystemServerClassLoaderContext(classPathForElement);
int dexoptNeeded;
try {
dexoptNeeded = DexFile.getDexOptNeeded(
classPathElement, instructionSet, systemServerFilter,
- null /* classLoaderContext */, false /* newProfile */,
- false /* downgrade */);
+ classLoaderContext, false /* newProfile */, false /* downgrade */);
} catch (FileNotFoundException ignored) {
// Do not add to the classpath.
Log.w(TAG, "Missing classpath element for system server: " + classPathElement);
@@ -684,8 +685,6 @@ public class ZygoteInit {
final String compilerFilter = systemServerFilter;
final String uuid = StorageManager.UUID_PRIVATE_INTERNAL;
final String seInfo = null;
- final String classLoaderContext =
- getSystemServerClassLoaderContext(classPathForElement);
final int targetSdkVersion = 0; // SystemServer targets the system's SDK version
try {
installd.dexopt(classPathElement, Process.SYSTEM_UID, packageName,