summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2017-11-03 01:30:30 +0000
committer android-build-merger <android-build-merger@google.com> 2017-11-03 01:30:30 +0000
commit565ff1784a583951e91c4418f6c8f3062e610e18 (patch)
treec4a7b49010c7b6b95f140657a0165d4f54a7ebe5
parent6f8a3cee0e9c7fa290a41a4480a03206c790eb7f (diff)
parente9e3bfe353b65303a4d41840d2b751b548f4c147 (diff)
Merge "[framework] Compile secondary dex files in isolation"
am: e9e3bfe353 Change-Id: I8f0d9303b3656a298700e26a377d89b7fdd81b4e
-rw-r--r--services/core/java/com/android/server/pm/PackageDexOptimizer.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index 2e955be6a21b..ef015e7e418b 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -366,18 +366,13 @@ public class PackageDexOptimizer {
+ " dexoptFlags=" + printDexoptFlags(dexoptFlags)
+ " target-filter=" + compilerFilter);
- String classLoaderContext;
- if (dexUseInfo.isUnknownClassLoaderContext() ||
- dexUseInfo.isUnsupportedClassLoaderContext() ||
- dexUseInfo.isVariableClassLoaderContext()) {
- // If we have an unknown (not yet set), unsupported (custom class loaders), or a
- // variable class loader chain, compile without a context and mark the oat file with
- // SKIP_SHARED_LIBRARY_CHECK. Note that his might lead to a incorrect compilation.
- // TODO(calin): We should just extract in this case.
- classLoaderContext = SKIP_SHARED_LIBRARY_CHECK;
- } else {
- classLoaderContext = dexUseInfo.getClassLoaderContext();
- }
+ // TODO(calin): b/64530081 b/66984396. Use SKIP_SHARED_LIBRARY_CHECK for the context
+ // (instead of dexUseInfo.getClassLoaderContext()) in order to compile secondary dex files
+ // in isolation (and avoid to extract/verify the main apk if it's in the class path).
+ // Note this trades correctness for performance since the resulting slow down is
+ // unacceptable in some cases until b/64530081 is fixed.
+ String classLoaderContext = SKIP_SHARED_LIBRARY_CHECK;
+
try {
for (String isa : dexUseInfo.getLoaderIsas()) {
// Reuse the same dexopt path as for the primary apks. We don't need all the