diff options
| author | 2019-05-28 23:47:22 +0000 | |
|---|---|---|
| committer | 2019-05-28 23:47:22 +0000 | |
| commit | b2f97986881ff1153c545e2da8dddfb1bfb2a64c (patch) | |
| tree | 32b467af0c2ba78a3322f6969c6a1a90c986dcb9 | |
| parent | 3996c9eb72bb0c6dc96cc0ca01dfbf36f7c6a4e2 (diff) | |
| parent | a349dde6064dc310c0d3f1ac7f4445e414515a78 (diff) | |
Merge "Do not fully compiled debuggable apps"
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageDexOptimizer.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java index 662352679c3b..6ae05ff50455 100644 --- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java +++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java @@ -508,13 +508,25 @@ public class PackageDexOptimizer { */ private String getRealCompilerFilter(ApplicationInfo info, String targetCompilerFilter, boolean isUsedByOtherApps) { - int flags = info.flags; - boolean vmSafeMode = (flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0; // When a priv app is configured to run out of box, only verify it. if (info.isPrivilegedApp() && DexManager.isPackageSelectedToRunOob(info.packageName)) { return "verify"; } - if (vmSafeMode) { + + // We force vmSafeMode on debuggable apps as well: + // - the runtime ignores their compiled code + // - they generally have lots of methods that could make the compiler used run + // out of memory (b/130828957) + // Note that forcing the compiler filter here applies to all compilations (even if they + // are done via adb shell commands). That's ok because right now the runtime will ignore + // the compiled code anyway. The alternative would have been to update either + // PackageDexOptimizer#canOptimizePackage or PackageManagerService#getOptimizablePackages + // but that would have the downside of possibly producing a big odex files which would + // be ignored anyway. + boolean vmSafeModeOrDebuggable = ((info.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0) + || ((info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0); + + if (vmSafeModeOrDebuggable) { return getSafeModeCompilerFilter(targetCompilerFilter); } |