From 5e07a0d9cacb1bf943f4617b1edcb930e1578dad Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 15 Jun 2017 19:09:38 -0700 Subject: [PATCH] Add property for system server compiler filter The property is dalvik.vm.systemservercompilerfilter, this changes if dexopt is needed. Bug: 62356545 Test: adb shell setprop dalvik.vm.systemservercompilerfilter quicken Test: adb shell stop && adb shell start Change-Id: I2ef3737f24816a4cb75e718abf274a891eb9fda1 --- core/java/com/android/internal/os/ZygoteInit.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 2c0f8e4a373f..385976c187ed 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -542,13 +542,13 @@ public class ZygoteInit { for (String classPathElement : classPathElements) { // System server is fully AOTed and never profiled // for profile guided compilation. - // TODO: Make this configurable between INTERPRET_ONLY, SPEED, SPACE and EVERYTHING? + String systemServerFilter = SystemProperties.get( + "dalvik.vm.systemservercompilerfilter", "speed"); int dexoptNeeded; try { dexoptNeeded = DexFile.getDexOptNeeded( - classPathElement, instructionSet, "speed", - false /* newProfile */); + classPathElement, instructionSet, systemServerFilter, false /* newProfile */); } catch (FileNotFoundException ignored) { // Do not add to the classpath. Log.w(TAG, "Missing classpath element for system server: " + classPathElement); @@ -566,7 +566,7 @@ public class ZygoteInit { final String packageName = "*"; final String outputPath = null; final int dexFlags = 0; - final String compilerFilter = "speed"; + final String compilerFilter = systemServerFilter; final String uuid = StorageManager.UUID_PRIVATE_INTERNAL; final String seInfo = null; try { -- 2.11.0