Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c0278d3 authored by David Brazdil's avatar David Brazdil Committed by Gerrit Code Review
Browse files

Merge "Revert "[framework] Compile secondary dex files in isolation""

parents 989e767e 22217f6a
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -404,12 +404,17 @@ public class PackageDexOptimizer {
                + " dexoptFlags=" + printDexoptFlags(dexoptFlags)
                + " target-filter=" + compilerFilter);

        // 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;
        String classLoaderContext;
        if (dexUseInfo.isUnknownClassLoaderContext() || dexUseInfo.isVariableClassLoaderContext()) {
            // If we have an unknown (not yet set), or a variable class loader chain, compile
            // without a context and mark the oat file with SKIP_SHARED_LIBRARY_CHECK. Note that
            // this might lead to a incorrect compilation.
            // TODO(calin): We should just extract in this case.
            classLoaderContext = SKIP_SHARED_LIBRARY_CHECK;
        } else {
            classLoaderContext = dexUseInfo.getClassLoaderContext();
        }

        int reason = options.getCompilationReason();
        try {
            for (String isa : dexUseInfo.getLoaderIsas()) {
+2 −4
Original line number Diff line number Diff line
@@ -863,15 +863,13 @@ public class PackageDexUsage extends AbstractStatsBase<Void> {

        public String getClassLoaderContext() { return mClassLoaderContext; }

        @VisibleForTesting
        /* package */ boolean isUnknownClassLoaderContext() {
        public boolean isUnknownClassLoaderContext() {
            // The class loader context may be unknown if we loaded the data from a previous version
            // which didn't save the context.
            return UNKNOWN_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
        }

        @VisibleForTesting
        /* package */ boolean isVariableClassLoaderContext() {
        public boolean isVariableClassLoaderContext() {
            return VARIABLE_CLASS_LOADER_CONTEXT.equals(mClassLoaderContext);
        }
    }